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

ELEMENT(NULL) causes an assertion failure

    XMLWordPrintableJSON

Details

    Description

      Adding the following test to SqlValidatorTest:

      @Test void testElement() {
          expr("element(null)").columnType("null");
      }
      

      causes an assertion failure. The bottom of the stack trace is the following:

      	at org.apache.calcite.sql.type.ReturnTypes$2.get(ReturnTypes.java:577)
      	at org.apache.calcite.sql.type.ReturnTypes$2.get(ReturnTypes.java:571)
      	at org.apache.calcite.sql.ExplicitOperatorBinding.getOperandType(ExplicitOperatorBinding.java:78)
      	at org.apache.calcite.sql.SqlOperatorBinding$1.get(SqlOperatorBinding.java:255)
      	at org.apache.calcite.sql.SqlOperatorBinding$1.get(SqlOperatorBinding.java:253)
      	at org.apache.calcite.sql.type.SqlTypeFactoryImpl.leastRestrictive(SqlTypeFactoryImpl.java:174)
      	at org.apache.calcite.rel.type.RelDataTypeFactory.leastRestrictive(RelDataTypeFactory.java:222)
      	at org.apache.calcite.sql.type.ReturnTypes.lambda$static$3(ReturnTypes.java:537)
      	at org.apache.calcite.sql.type.ReturnTypes.lambda$static$6(ReturnTypes.java:586)
      	at org.apache.calcite.sql.type.SqlTypeTransformCascade.inferReturnType(SqlTypeTransformCascade.java:58)
      	at org.apache.calcite.sql.SqlOperator.inferReturnType(SqlOperator.java:534)
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mbudiu Mihai Budiu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: