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.

        Activity

        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/6201013a .
        Hide
        julianhyde Julian Hyde added a comment -

        Resolved in release 1.7.0 (2016-03-22).

        Show
        julianhyde Julian Hyde added a comment - Resolved in release 1.7.0 (2016-03-22).

          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:

              Development