[ 
https://issues.apache.org/jira/browse/CALCITE-6095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17785340#comment-17785340
 ] 

Julian Hyde commented on CALCITE-6095:
--------------------------------------

What would be the correct behavior? I agree that {{AssertionError}} is wrong.

> 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
>            Priority: Minor
>
> 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