Skip to content

[CALCITE-2101] Push count(column) using filtered aggregate#586

Closed
b-slim wants to merge 2 commits intoapache:masterfrom
b-slim:push_count_column_CALCITE-2101
Closed

[CALCITE-2101] Push count(column) using filtered aggregate#586
b-slim wants to merge 2 commits intoapache:masterfrom
b-slim:push_count_column_CALCITE-2101

Conversation

@b-slim
Copy link
Copy Markdown
Contributor

@b-slim b-slim commented Dec 19, 2017

Push count(column) using filtered aggregation.
This PR is somehow related to
#585 and #585
Thus would like to get those PR merged first then will adjust the test cases and rebase this one afterward.

@b-slim
Copy link
Copy Markdown
Contributor Author

b-slim commented Dec 19, 2017

@jcamachor this PR is good to review as well but probably will need to adjust test results once we pull in the other fixes

@b-slim b-slim force-pushed the push_count_column_CALCITE-2101 branch from 9de5d56 to f47b245 Compare December 19, 2017 22:12
@b-slim b-slim force-pushed the push_count_column_CALCITE-2101 branch from f47b245 to f275464 Compare December 19, 2017 23:45
Copy link
Copy Markdown
Member

@nishantmonu51 nishantmonu51 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@jcamachor jcamachor left a comment

Choose a reason for hiding this comment

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

Left a couple of minor comments. @b-slim , could you address them so we can check it in?

}
aggregation = new JsonAggregation("count", name, only);
if (aggCall.getArgList().size() == 1) {
final JsonFilter filter = new JsonCompositeFilter(JsonFilter.Type.NOT,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@b-slim , can we add a comment here explaining what this is doing? It does not seem straightforward unless you understand well how Druid works (specially the JsonSelector(only, null, null))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

// Druid count aggregator can handle 3 scenarios:
// 1. count(distinct col) when approximate results
// are acceptable and col is not a metric
// FYI case exact count(distinct column) is handled using group by and count as well
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a follow-up JIRA for this? If there is not, can we create it? Then we can reference it here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no am saying that we are handling this case already and the planer already does write it as druid group by.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

OK, got it, thanks

@asfgit asfgit closed this in 8eb7d0f Dec 20, 2017
@b-slim b-slim changed the title [WIP][CALCITE-2101] Push count(column) using filtered aggregate [CALCITE-2101] Push count(column) using filtered aggregate Dec 21, 2017
7mming7 pushed a commit to Kyligence/calcite that referenced this pull request Jan 23, 2021
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.

3 participants