Mihai Budiu created CALCITE-6095:
------------------------------------

             Summary: Arithmetic expression with VARBINARY value causes 
AssertionFailure
                 Key: CALCITE-6095
                 URL: https://issues.apache.org/jira/browse/CALCITE-6095
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.35.0
            Reporter: Mihai Budiu


The following SqlOperatorTest causes an AssertionFailure:

{code:java}
f.check("SELECT x'31' + 0", "INTEGER NOT NULL", "50");
{code}

The top of the stack trace is:

{code}
        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)
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to