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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.9.0
    • 1.9.0
    • core
    • 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

              jcamacho Jesús Camacho Rodríguez
              jcamacho Jesús Camacho Rodríguez
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: