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

Return type check fails with OVER

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • core
    • None

    Description

      The following RelMetadataTest test fails:

      @Test void testOverNoPartitioning() {
        sql("select max(empno) over (rows between 2 preceding and 0 following) from emp")
          .assertThatAreColumnsUnique(bitSetOf(0), is(false))
          .assertThatUniqueKeysAre();
      }

      With this error:

      java.lang.AssertionError: Conversion to relational algebra failed to preserve datatypes:
      validated type:
      RecordType(INTEGER EXPR$0) NOT NULL
      converted type:
      RecordType(INTEGER NOT NULL EXPR$0) NOT NULL
      rel:
      LogicalProject(EXPR$0=[MAX($0) OVER ()])
        LogicalTableScan(table=[[CATALOG, SALES, EMP]])
       at org.apache.calcite.sql2rel.SqlToRelConverter.checkConvertedType(SqlToRelConverter.java:507)
       at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:622)
       at org.apache.calcite.sql.test.AbstractSqlTester.convertSqlToRel2(AbstractSqlTester.java:541)
       at org.apache.calcite.sql.test.SqlTester.convertSqlToRel(SqlTester.java:291)
       at org.apache.calcite.test.RelMetadataFixture.sqlToRel(RelMetadataFixture.java:189)
       at org.apache.calcite.test.RelSupplier$SqlRelSupplier.apply2(RelSupplier.java:104)
       at org.apache.calcite.test.RelMetadataFixture.toRel(RelMetadataFixture.java:195)
       at org.apache.calcite.test.RelMetadataFixture.assertThatAreColumnsUnique(RelMetadataFixture.java:508)

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              pauljackson123 Paul Jackson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: