[ 
https://issues.apache.org/jira/browse/FLINK-41572?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martijn Visser updated FLINK-41572:
-----------------------------------
    Release Note: Comparing a numeric with a character string value with =, <>, 
IS DISTINCT FROM or IS NOT DISTINCT FROM now fails during SQL validation, 
including COMPILE PLAN, with a message that names the comparison and suggests a 
CAST. This also applies to ROW, ARRAY, MAP and MULTISET values whose fields or 
elements pair a numeric with a character string; these comparisons used to run 
and returned FALSE (ROW, ARRAY) or TRUE (MAP). Before, the scalar case failed 
during code generation, and COMPILE PLAN wrote a plan that failed at EXECUTE 
PLAN. Queries in which the optimizer removed such a comparison, for example 
WHERE int_col = str_col OR TRUE, and views with such a column that a query 
doesn't select, used to run and now fail. Add an explicit CAST.

> 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
>            Assignee: Hanyu Zheng
>            Priority: Major
>              Labels: pull-request-available
>
> 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