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

Benchao Li commented on CALCITE-5592:
-------------------------------------

FYI, there is a discussion in the dev ML before: 
https://lists.apache.org/thread/hlj500zyvf6ydg21zsjhwjpwt727snoq 

> 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
>            Priority: Major
>
> 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)

Reply via email to