Hanyu Zheng created FLINK-41572:
-----------------------------------

             Summary: Improve the "implicit type conversion between X and Y is 
not supported now" error
                 Key: FLINK-41572
                 URL: https://issues.apache.org/jira/browse/FLINK-41572
             Project: Flink
          Issue Type: Improvement
          Components: Table SQL / Planner
    Affects Versions: 2.3.0
            Reporter: Hanyu Zheng
             Fix For: 2.3.0


Comparing a numeric column with a character string column, for example `WHERE 
int_col = str_col`, fails with:

{noformat}
org.apache.flink.table.api.ValidationException: implicit type conversion 
between INTEGER and VARCHAR is not supported now
{noformat}

ScalarOperatorGens.checkImplicitConversionValidity throws this during code 
generation, after the query has already passed validation. The message names 
only the two type roots. It doesn't say which expression failed or how to fix 
the query, and "now" reads like a temporary limitation. The TODO there refers 
to FLIP-154, which has not been implemented.

Until FLIP-154 is implemented, the error should name the expression and suggest 
an explicit CAST. It would also be better to raise it during validation. 
FLINK-29556 reports the same problem for join conditions 
(JoinConditionTypeCoerceRule), which has its own message.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to