开发者社区> 问答> 正文

flink sql 计算列不支持comment怎么办?

link版本:1.11.1

官网文档中定义如下:

<computed_column_definition>:

column_name AS computed_column_expression [COMMENT column_comment]

我看到官方文档中计算列是可以指定column_comment的,但我尝试了一下发现会报错

使用方式和报错信息如下:

create table t1(

data_time STRING,

row1_time AS to_timestamp(data_time) COMMENT 'test'

WATERMARK FOR row1_time AS row1_time - INTERVAL '5' SECOND

) with(...)

org.apache.flink.sql.parser.impl.ParseException: Encountered "COMMENT" at line 1, column 74.

Was expecting one of:

"FILTER" ...

"OVER" ...

"WITHIN" ...

")" ...

"," ...

"." ...

"NOT" ...

"IN" ...

"<" ...

"<=" ...

">" ...

">=" ...

"=" ...

"<>" ...

"!=" ...

"BETWEEN" ...

"LIKE" ...

"SIMILAR" ...

"+" ...

"-" ...

"*" ...

"/" ...

"%" ...

"||" ...

"AND" ...

"OR" ...

"IS" ...

"MEMBER" ...

"SUBMULTISET" ...

"CONTAINS" ...

"OVERLAPS" ...

"EQUALS" ...

"PRECEDES" ...

"SUCCEEDS" ...

"IMMEDIATELY" ...

"MULTISET" ...

"[" ...

"FORMAT" ...

"IGNORE" ...

"RESPECT" ...

at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.generateParseException(F linkSqlParserImpl.java:36086)

at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.jj_consume_token(FlinkSq lParserImpl.java:35900)

at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.SqlCreateTable(FlinkSqlP arserImpl.java:5271)

at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.SqlCreateExtended(FlinkS qlParserImpl.java:6269)

at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.SqlCreate(FlinkSqlParser Impl.java:19047)

at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.SqlStmt(FlinkSqlParserIm pl.java:3308)

at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.SqlStmtList(FlinkSqlPars erImpl.java:2775)

at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.parseSqlStmtList(FlinkSq lParserImpl.java:252)

at org.apache.calcite.sql.parser.SqlParser.parseStmtList(SqlParser.java:201) *来自志愿者整理的flink邮件归档

展开
收起
游客sadna6pkvqnz6 2021-12-07 16:46:41 1243 0
1 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
Flink CDC Meetup PPT - 覃立辉 立即下载
Flink CDC Meetup PPT - 孙家宝 立即下载
Flink CDC Meetup PPT - 徐榜江 立即下载