Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] (nereids)implement showReplicaDistributionCommand in nereids #44498

Merged
merged 3 commits into from
Nov 27, 2024

Conversation

Vallishp
Copy link
Contributor

@Vallishp Vallishp commented Nov 23, 2024

What problem does this PR solve?

Issue Number: close #42782
#42837

Related PR: #xxx

Problem Summary:
implement showReplicaDistributionCommand in nereids

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@Vallishp Vallishp force-pushed the show_distribution branch 2 times, most recently from 1441ad8 to 4b5b7ce Compare November 23, 2024 07:56
private final TableNameInfo tableNameInfo;
private final TableScanParams scanParams;
private final TableSnapshot tableSnapShot;
private final PartitionNames partitionNames;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use PartitionNamesInfo.java from https://github.com/apache/doris/pull/44058/files . This pr has some extra work to do and will not be merged in a short time. So you can add PartitionNamesInfo.java in your pr.

@Vallishp Vallishp force-pushed the show_distribution branch 2 times, most recently from 40f1d48 to 4f77dff Compare November 24, 2024 07:01
@Vallishp Vallishp marked this pull request as ready for review November 24, 2024 07:01
@Vallishp
Copy link
Contributor Author

run buildall

/**
* show replica distribution command
*/
public class ShowReplicaDistributionCommand extends ShowCommand {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please help update the two functions in Command.java (add ConnectContext as param)

public void verifyCommandSupported(ConnectContext ctx) throws DdlException {
    // check command has been supported in cloud mode
    if (Config.isCloudMode()) {
        checkSupportedInCloudMode(ctx);
    }
}

protected void checkSupportedInCloudMode(ConnectContext ctx) throws DdlException {}

and then change the caller in StmtExecutor.java
((Command) logicalPlan).verifyCommandSupported(context);

at last, override checkSupportedInCloudMode method as bellow

protected void checkSupportedInCloudMode(ConnectContext ctx) throws DdlException {
    if (!ctx.getCurrentUserIdentity().getUser().equals(Auth.ROOT_USER)) {
        LOG.info("stmt={}, not supported in cloud mode", stmt.toString());
        throw new AnalysisException("Unsupported operation");
    }
}

@Vallishp
Copy link
Contributor Author

run buildall

@Vallishp
Copy link
Contributor Author

run buildall

@Vallishp
Copy link
Contributor Author

run buildall

@Vallishp
Copy link
Contributor Author

run buildall

1 similar comment
@Vallishp
Copy link
Contributor Author

run buildall

@Vallishp
Copy link
Contributor Author

run buildall

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Nov 27, 2024
Copy link
Contributor

PR approved by at least one committer and no changes requested.

Copy link
Contributor

PR approved by anyone and no changes requested.

@starocean999 starocean999 merged commit 3ef3c0f into apache:master Nov 27, 2024
23 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by one committer. reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] (nereids)implement showREplicaDistributionCommand in nereids
4 participants