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

Metadata provider should not pull predicates up through GROUP BY ()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.0
    • Fix Version/s: 1.9.0
    • Component/s: core
    • Labels:
      None

      Description

      In org.apache.calcite.rel.metadata.RelMdPredicates.java:

      ...
          for (RexNode r : inputInfo.pulledUpPredicates) {
            ImmutableBitSet rCols = RelOptUtil.InputFinder.bits(r);
            if (groupKeys.contains(rCols)) {
              r = r.accept(new RexPermuteInputsShuttle(m, input));
              aggPullUpPredicates.add(r);
            }
          }
      ...
      

      The check does not take into account that rCols might be empty, and then r cannot be pulled up e.g. count(*).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jcamachorodriguez Jesus Camacho Rodriguez
                Reporter:
                jcamachorodriguez Jesus Camacho Rodriguez
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: