Jianhui Dong created CALCITE-5592:
-------------------------------------
Summary: SqlValidatorImpl#validateWhereOrOn does not derive the
the correct operand type for '='
Key: CALCITE-5592
URL: https://issues.apache.org/jira/browse/CALCITE-5592
Project: Calcite
Issue Type: Bug
Components: core
Reporter: Jianhui Dong
org.apache.calcite.sql.fun.SqlStdOperatorTable#EQUALS use
InferTypes.FIRST_KNOWN as its SqlOperandTypeInference, and it will derive the
type incorrectly as follows:
{code:java}
CREATE TABLE source (
a VARCHAR
)
SELECT * FROM source WHERE a = 1;{code}
it will think that the type of operands `source.a` and `1` both be
VARCHAR(65536), but exactly the type of `1` maybe INTEGER, and I want to know
if should we throw an exception for this kind type check of where clause?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)