Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
In SqlToRelConverter use RelBuilder for creating Aggregate. Currently we call LogicalAggregate.create directly, and that misses some optimizations.
Add config option RelBuilder.Config.aggregateUnique() to disable the optimization that we don't create an Aggregate if the input is already unique on the GROUP BY key. Without it, some tests in SqlToRelConverterTest become trivial.
Also, that optimization is not valid if there are multiple group sets. (Because we should output multiple rows, and Project only returns one.) So disable it in that case.
Move the the code added by CALCITE-1824 from SqlToRelConverter to RelBuilder. Now the GROUP_ID is handled correctly even if created via RelBuilder.
Attachments
Issue Links
- is duplicated by
-
CALCITE-4665 Allow Aggregate.groupSet to contain columns not in any of the groupSets
- Closed
- is related to
-
CALCITE-4234 RelBuilder throws NullPointerException while implementing GROUP_ID()
- In Progress
-
CALCITE-1824 GROUP_ID returns wrong result
- Closed