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());
          }
        }
      
      

        Activity

        Hide
        jcamachorodriguez Jesus Camacho Rodriguez added a comment -

        Resolved in release 1.13.0 (2017-06-26).

        Show
        jcamachorodriguez Jesus Camacho Rodriguez added a comment - Resolved in release 1.13.0 (2017-06-26).
        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/fa8defdd .
        Hide
        minjikim MinJi Kim added a comment -

        I ran a clean full build (mvn clean install) on calcite root and everything passed. I was concerned that I might be missing something. Any specific test cases that I should look into adding?

        Show
        minjikim MinJi Kim added a comment - I ran a clean full build (mvn clean install) on calcite root and everything passed. I was concerned that I might be missing something. Any specific test cases that I should look into adding?
        Hide
        julianhyde Julian Hyde added a comment -

        It looks as if that line was added in CALCITE-751. IIRC, there were problems with cycles if HepRelVertex or RelSubset were involved, and in the RelSubset case we solved the problem using the simplyProjects method. There were two follow-up cases, CALCITE-794 (fixed) and CALCITE-1048 (not fixed).

        Does the test suite pass?

        Show
        julianhyde Julian Hyde added a comment - It looks as if that line was added in CALCITE-751 . IIRC, there were problems with cycles if HepRelVertex or RelSubset were involved, and in the RelSubset case we solved the problem using the simplyProjects method. There were two follow-up cases, CALCITE-794 (fixed) and CALCITE-1048 (not fixed). Does the test suite pass?
        Hide
        minjikim MinJi Kim added a comment -

        I wanted to make sure that this isn't going to cause some regression. I wasn't sure if this was disabled for a specific reason unknown to me. Thanks!

        https://github.com/apache/calcite/pull/420

        Show
        minjikim MinJi Kim added a comment - I wanted to make sure that this isn't going to cause some regression. I wasn't sure if this was disabled for a specific reason unknown to me. Thanks! https://github.com/apache/calcite/pull/420

          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:

              Development