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
SQL: Ability to generate exact distinct count queries. #3999
Conversation
a2bdd0c
to
11897c5
Compare
👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 looks good to me, very useful feature.
@@ -122,6 +122,14 @@ public int getMaxTopNLimit() | |||
return 0; | |||
} | |||
}; | |||
private static final PlannerConfig PLANNER_CONFIG_NO_HLL = new PlannerConfig() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nit: rename to PLANNER_CONFIG_NO_APPROXIMATION ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also PLANNER_CONFIG_NO_TOPN to disable topn approximations, so I want to keep them different for that reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two kinds of approximations can be toggled separately
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok.
I'm going to make one tweak to the wording, please don't merge just yet |
Haha, oops. I'll do another PR |
Uses Calcite's AggregateExpandDistinctAggregatesRule to generate exact distinct count queries when useApproximateCountDistinct is "false". These query plans use nested groupBys.