You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jark Wu (Jira)" <ji...@apache.org> on 2021/06/09 02:34:00 UTC
[jira] [Created] (FLINK-22936) Support column comment in Schema and
ResolvedSchema
Jark Wu created FLINK-22936:
-------------------------------
Summary: Support column comment in Schema and ResolvedSchema
Key: FLINK-22936
URL: https://issues.apache.org/jira/browse/FLINK-22936
Project: Flink
Issue Type: New Feature
Components: Table SQL / API
Reporter: Jark Wu
Fix For: 1.14.0
In order to support column comment in catalog (FLINK-18958), we should first support column comment in Schema and ResolvedSchema.
The API is up to discuss. Currently, we already have 10 methods for adding a column in {{Schema}}. If we want to support column comment for each kind of column, the number of column methods may double. It's not easy to maintain in the long term, and make the API complex.
Another alternative is adding a new method {{comment(String)}} which will apply comment to the previous column. This is not a good builder style, but can make the building concise.
For example,
{code}
Schema.newBuilder()
.column("ts", DataTypes.TIMESTAMP(3)).comment("log timestamp")
.columnByExpression("proctime", "PROCTIME()").comment("processing time")
.watermark("ts", "ts - INTERVAL '5' SECOND")
.build()
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)