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

Moses commented on FLINK-22427:
-------------------------------

[~jark] Agree.

> Support DEFAULT value syntax to simplify data clean process
> -----------------------------------------------------------
>
>                 Key: FLINK-22427
>                 URL: https://issues.apache.org/jira/browse/FLINK-22427
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table SQL / API
>         Environment: Flink version 1.11.1
>            Reporter: Moses
>            Priority: Major
>
>  The SQL statement is designed as below:
> {code:sql}
> CREATE TABLE user_behavior (
>     user_id BIGINT,
>     item_id BIGINT,
>     category_id BIGINT,
>     behavior STRING default 'soo', ---- Here I wanna use default value
> ) WITH (
>     'connector' = 'kafka', 
>     'topic' = 'user_behavior',
>     'scan.startup.mode' = 'earliest-offset',
>     'properties.bootstrap.servers' = 'kafka:9094'
>     'format' = 'json'
> );
> {code}
>  Throws Exception:
> {code:java}
> [ERROR] Could not execute SQL statement. Reason:
>       org.apache.flink.sql.parser.impl.ParseException: Encountered "default" 
> at line 5, column 21.
>       Was expecting one of:
>           "CONSTRAINT" ...
> {code}
>  It's more friendly for us to support that allowing users to set default 
> value during table schema definition. That will reduce UDXF usage and 
> simplify data clean process to some extent.
> There are two points need to be solved:
>  * Support SQL grammar.
>  * Set field to specified value while field value is missing.
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to