Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1059

Not valid to convert Aggregate with on empty to empty if its GROUP BY key is empty

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.0
    • Component/s: None
    • Labels:
      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.

        Attachments

          Activity

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              julianhyde Julian Hyde
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: