[CALCITE-6457] The ARRAY_CONTAINS function wrongly returns false when arrayComponentType and op1 type are different#3844
[CALCITE-6457] The ARRAY_CONTAINS function wrongly returns false when arrayComponentType and op1 type are different#3844caicancai wants to merge 1 commit intoapache:mainfrom
Conversation
… arrayComponentType and op1 type are different
|
| return false; | ||
| } | ||
|
|
||
| if (!arrayComponentType.equalsSansFieldNames(biggest)) { |
There was a problem hiding this comment.
the adjustTypeForArrayFunctions is used in the return type inference in the other places, and not in the operand type checker. This is related to the same question I had which is whether the type checker can modify the expression.
There was a problem hiding this comment.
@mihaibudiu I think it is appropriate to do type casting in the type checker, such as checkOperandTypes from FamilyOperandTypeChecker which implements ImplicitCastOperandTypeChecker
some background
There was a problem hiding this comment.
It is appropriate to insert casts in the TypeCoercion phase, but in type checking it's too late.
See https://issues.apache.org/jira/browse/CALCITE-6743 for the kinds of problems this creates: the types computed by the validator no longer reflect the expression tree that is being type checked.



https://issues.apache.org/jira/browse/CALCITE-6457