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

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

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.11.0
    • Component/s: core
    • Labels:

      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)
      

        Issue Links

          Activity

          Hide
          julianhyde Julian Hyde added a comment -
          Show
          julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/e4d3ad0b . Thanks for the PR, Jess Balint !
          Hide
          julianhyde Julian Hyde added a comment -

          Resolved in release 1.11.0 (2017-01-11).

          Show
          julianhyde Julian Hyde added a comment - Resolved in release 1.11.0 (2017-01-11).

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development