[jira] [Commented] (FLINK-15553) Create table ddl support comment after computed column

2020-02-15 Thread hailong wang (Jira)


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

hailong wang commented on FLINK-15553:
--

Hi [~danny0405], could you help me hava a look? I have aleady had a patch for 
it according to the above.

> Create table ddl support  comment after computed column
> ---
>
> Key: FLINK-15553
> URL: https://issues.apache.org/jira/browse/FLINK-15553
> Project: Flink
>  Issue Type: Improvement
>  Components: Table SQL / API
>Affects Versions: 1.10.0
>Reporter: hailong wang
>Priority: Major
> Fix For: 1.11.0
>
>
> For now, we can define computed column in create table ddl, but we can not 
> add comment after it just like regular table column, So we should support it, 
>  it's grammar as follows:
> {code:java}
> col_name AS expr  [COMMENT 'string']
> {code}
> My idea is, we can introduce  class
> {code:java}
>  SqlTableComputedColumn{code}
> to wrap name, expression and comment,  And just get the element from it will 
> be ok.
> As for parserImpls.ftl, it can be like as follows:
> {code:java}
> identifier = SimpleIdentifier()
> 
> expr = Expression(ExprContext.ACCEPT_NON_QUERY)
> [   {
> String p = SqlParserUtil.parseString(token.image);
> comment = SqlLiteral.createCharString(p, getPos());
> }]
> {
> SqlTableComputedColumn tableComputedColumn =
> new SqlTableComputedColumn(identifier, expr, comment, getPos());
> context.columnList.add(tableComputedColumn);
> }{code}
>  



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


[jira] [Commented] (FLINK-15553) Create table ddl support comment after computed column

2020-01-12 Thread Jark Wu (Jira)


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

Jark Wu commented on FLINK-15553:
-

cc [~danny0405]

> Create table ddl support  comment after computed column
> ---
>
> Key: FLINK-15553
> URL: https://issues.apache.org/jira/browse/FLINK-15553
> Project: Flink
>  Issue Type: Improvement
>  Components: Table SQL / API
>Affects Versions: 1.10.0
>Reporter: hailong wang
>Priority: Major
> Fix For: 1.11.0
>
>
> For now, we can define computed column in create table ddl, but we can not 
> add comment after it just like regular table column, So we should support it, 
>  it's grammar as follows:
> {code:java}
> col_name AS expr  [COMMENT 'string']
> {code}
> My idea is, we can introduce  class
> {code:java}
>  SqlTableComputedColumn{code}
> to wrap name, expression and comment,  And just get the element from it will 
> be ok.
> As for parserImpls.ftl, it can be like as follows:
> {code:java}
> identifier = SimpleIdentifier()
> 
> expr = Expression(ExprContext.ACCEPT_NON_QUERY)
> [   {
> String p = SqlParserUtil.parseString(token.image);
> comment = SqlLiteral.createCharString(p, getPos());
> }]
> {
> SqlTableComputedColumn tableComputedColumn =
> new SqlTableComputedColumn(identifier, expr, comment, getPos());
> context.columnList.add(tableComputedColumn);
> }{code}
>  



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