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

RelMdColumnUniqueness for HepRelVertex

    Details

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

      Description

      In generated code/JaninoRelMetadataProvider, areColumnsUnique() is supported for HepRelVertex, by using HepRelVertex.getCurrentRel(). In the underlying RelMetadata (RelMdColumnUniqueness.java), the same code is disabled.

      This is causing some problems for me since I am trying to use RelMdColumnUniquess without going through the JaninoRelMetadataProvider For me, enabling the same code in RelMdColumnUniquess solved the problem for me.

      Although I am uploading a small patch for this soon, I wanted to see if there were any concerns for enabling RelMdColumnUniqueness for HepRelVertex.

        private java.lang.Boolean areColumnsUnique_(
            org.apache.calcite.rel.RelNode r,
            org.apache.calcite.rel.metadata.RelMetadataQuery mq,
            org.apache.calcite.util.ImmutableBitSet a0,
            boolean a1) {
          switch (relClasses.indexOf(r.getClass())) {
          default:
            return provider0.areColumnsUnique((org.apache.calcite.rel.RelNode) r, mq, a0, a1);
          case 2:
            return provider0.areColumnsUnique((org.apache.calcite.plan.volcano.RelSubset) r, mq, a0, a1);
          case 3:
            return areColumnsUnique(((org.apache.calcite.plan.hep.HepRelVertex) r).getCurrentRel(), mq, a0, a1);
          case 4:
          case 5:
            return provider0.areColumnsUnique((org.apache.calcite.rel.convert.Converter) r, mq, a0, a1);
          case 6:
          case 24:
          case 30:
            return provider0.areColumnsUnique((org.apache.calcite.rel.core.Aggregate) r, mq, a0, a1);
          case 8:
          case 32:
            return provider0.areColumnsUnique((org.apache.calcite.rel.core.Correlate) r, mq, a0, a1);
          case 9:
          case 33:
            return provider0.areColumnsUnique((org.apache.calcite.rel.core.Exchange) r, mq, a0, a1);
          case 10:
          case 25:
          case 34:
            return provider0.areColumnsUnique((org.apache.calcite.rel.core.Filter) r, mq, a0, a1);
          case 11:
          case 35:
            return provider0.areColumnsUnique((org.apache.calcite.rel.core.Intersect) r, mq, a0, a1);
          case 12:
          case 27:
          case 36:
          case 48:
            return provider0.areColumnsUnique((org.apache.calcite.rel.core.Join) r, mq, a0, a1);
          case 13:
          case 37:
            return provider0.areColumnsUnique((org.apache.calcite.rel.core.Minus) r, mq, a0, a1);
          case 14:
          case 26:
          case 38:
            return provider0.areColumnsUnique((org.apache.calcite.rel.core.Project) r, mq, a0, a1);
          case 15:
          case 39:
            return provider0.areColumnsUnique((org.apache.calcite.rel.core.Sort) r, mq, a0, a1);
          case 18:
          case 28:
          case 42:
            return provider0.areColumnsUnique((org.apache.calcite.rel.core.TableScan) r, mq, a0, a1);
          case 19:
          case 43:
          case 50:
            return provider0.areColumnsUnique((org.apache.calcite.rel.core.SetOp) r, mq, a0, a1);
          case 20:
          case 44:
            return provider0.areColumnsUnique((org.apache.calcite.rel.core.Values) r, mq, a0, a1);
          case -1:
            throw new org.apache.calcite.rel.metadata.JaninoRelMetadataProvider$NoHandler(r.getClass());
          }
        }
      
      

        Attachments

          Activity

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              minjikim MinJi Kim
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: