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

Add filter conditions for 'show partitions from table' syntax #2553

Merged
merged 3 commits into from
Jan 3, 2020

Conversation

caiconghui
Copy link
Contributor

add filter conditions for show partitions from table syntax, to filter partitions needed

@caiconghui
Copy link
Contributor Author

#2552

dbName = ClusterNamespace.getFullName(getClusterName(), dbName);
}

analyzeSynTax(analyzer);
Copy link
Contributor

Choose a reason for hiding this comment

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

analyze itself means analyze syntax, so no need to name like analyzeSynTax.
analyzeImpl is better. Like named in other class.

String leftKey = ((SlotRef) subExpr.getChild(0)).getColumnName();
if (subExpr instanceof BinaryPredicate) {
BinaryPredicate binaryPredicate = (BinaryPredicate) subExpr;
if (leftKey.equalsIgnoreCase("PartitionName") || leftKey.equalsIgnoreCase("State")) {
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 list the filter name at the beginning of the class like:

private static final String FILTER_PARTITION_NAME = "PartitionName";

So it would be more easy to maintain. And same as "State", "LastConsistencyCheckTime", ...

filterPartitionInfos = Lists.newArrayList();
for (List<Comparable> partitionInfo : partitionInfos) {
if (partitionInfo.size() != TITLE_NAMES.size()) {
LOG.warn("ParttitionInfos.size() " + partitionInfos.size()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is bug and should throw exception?

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

LGTM

@morningman morningman merged commit 42dfe13 into apache:master Jan 3, 2020
infearOnTheWay pushed a commit to infearOnTheWay/incubator-doris that referenced this pull request Jan 6, 2020
…#2553)

Add filter conditions for show partitions from table syntax, to filter partitions needed
morningman pushed a commit to morningman/doris that referenced this pull request Jan 8, 2020
…#2553)

Add filter conditions for show partitions from table syntax, to filter partitions needed
@chaoyli chaoyli mentioned this pull request Feb 10, 2020
@caiconghui caiconghui deleted the showPartitions branch May 25, 2020 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants