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

Arithmetic expression with VARBINARY value causes AssertionFailure

    XMLWordPrintableJSON

Details

    Description

      The following SqlOperatorTest causes an AssertionFailure:

      f.check("SELECT x'31' + 0", "INTEGER NOT NULL", "50");
      

      The top of the stack trace is:

      	at org.apache.calcite.sql.validate.implicit.AbstractTypeCoercion.needToCast(AbstractTypeCoercion.java:297)
      	at org.apache.calcite.sql.validate.implicit.AbstractTypeCoercion.coerceOperandType(AbstractTypeCoercion.java:117)
      	at org.apache.calcite.sql.validate.implicit.TypeCoercionImpl.binaryArithmeticWithStrings(TypeCoercionImpl.java:200)
      	at org.apache.calcite.sql.validate.implicit.TypeCoercionImpl.binaryArithmeticCoercion(TypeCoercionImpl.java:172)
      	at org.apache.calcite.sql.type.CompositeOperandTypeChecker.checkOperandTypes(CompositeOperandTypeChecker.java:261)
      	at org.apache.calcite.sql.SqlOperator.checkOperandTypes(SqlOperator.java:761)
      	at org.apache.calcite.sql.SqlOperator.validateOperands(SqlOperator.java:498)
      	at org.apache.calcite.sql.SqlOperator.deriveType(SqlOperator.java:607)
      	at org.apache.calcite.sql.SqlBinaryOperator.deriveType(SqlBinaryOperator.java:178)
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: