Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
It it not valid to convert Aggregate with on empty to empty if its GROUP BY key is empty. Consider the following SQL:
SELECT count(*) FROM emp WHERE FALSE
Even though the input is empty, the output is one row.
Fix affects PruneEmptyRules.AGGREGATE_INSTANCE.
Also, add a RelBuilderFactory argument to all rules in PruneEmptyRules and call RelBuilder.empty rather than LogicalValues.createEmpty.