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

RelBuilder.union() hits assertion when arguments can't have a common row type

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.11.0
    • core

    Description

      Creating a union throws an AssertionError when a common row type cannot be computed. e.g. (modified RelBuilderTest.testUnion()):

              builder.scan("DEPT")
                  .project(builder.field("DEPTNO"))
                  .scan("EMP")
                  .project(builder.field("EMPNO"), builder.field("SAL"))
                  .union(true)
      

      throws:

      java.lang.AssertionError: LogicalUnion#4
      
      	at org.apache.calcite.rel.AbstractRelNode.getRowType(AbstractRelNode.java:220)
      	at org.apache.calcite.tools.RelBuilder$Frame.<init>(RelBuilder.java:1623)
      	at org.apache.calcite.tools.RelBuilder$Frame.<init>(RelBuilder.java:1606)
      	at org.apache.calcite.tools.RelBuilder.push(RelBuilder.java:220)
      	at org.apache.calcite.tools.RelBuilder.setOp(RelBuilder.java:1032)
      	at org.apache.calcite.tools.RelBuilder.union(RelBuilder.java:1052)
      	at org.apache.calcite.tools.RelBuilder.union(RelBuilder.java:1042)
      	at org.apache.calcite.test.RelBuilderTest.testUnion(RelBuilderTest.java:719)
      

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              jbalint@gmail.com Jess Balint
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: