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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.7.0
    • 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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: