[
https://issues.apache.org/jira/browse/FLINK-27795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17542803#comment-17542803
]
Shengkai Fang commented on FLINK-27795:
---------------------------------------
The question is whether Flink should supports implicitly type coercion here,
which is a feature that Flink doesn't support yet.
Actually Flink proposes the discussion about type coercion in the
[FLIP-154|https://cwiki.apache.org/confluence/display/FLINK/FLIP-154%3A+SQL+Implicit+Type+Coercion].
But it has been slience for a long time.
The correct way to do this feature it to enable the config option in the
FlinkPlannerImpl[1]. But it's about the implementation and we can discuss after
the FLIP-154 is accepted.
[1]
https://github.com/apache/flink/blob/bf342d2f67a46e5266c3595734574db270f1b48c/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/calcite/FlinkPlannerImpl.scala#L102
> SqlValidatorException when insert null value
> --------------------------------------------
>
> Key: FLINK-27795
> URL: https://issues.apache.org/jira/browse/FLINK-27795
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / API
> Affects Versions: 1.14.4
> Reporter: linqichen
> Priority: Major
>
> Hello , I found a problem, when i try to insert null value.
> i think it is very common to insert null to string type value. We should
> solve this instead of using cast (xx as string)
> -----------------------------------------------------------------
> Flink SQL> create table print_1(
> > name string
> > ) with(
> > 'connector'='print'
> > );
> [INFO] Execute statement succeed.
> Flink SQL> insert into print_1 (name) values (null);
> {color:#de350b}*[ERROR] Could not execute SQL statement. Reason:*{color}
> {color:#de350b}*org.apache.calcite.sql.validate.SqlValidatorException:
> Illegal use of 'NULL'*{color}
>
--
This message was sent by Atlassian Jira
(v8.20.7#820007)