[
https://issues.apache.org/jira/browse/FLINK-36098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17876461#comment-17876461
]
Sergey Nuyanzin commented on FLINK-36098:
-----------------------------------------
I think we first should agree on what syntax should be used for that.
Based on what I've found so far it seems there is no common approach among the
vendors (even more: only few of them support this)
the current suggestion
{quote}
{code:sql}
ALTER TABLE my_table COMMENT 'New comment for my_table' {code}
{quote}
is similar to what MySQL[1] does.
Meanwhile Snowflake[2] has different syntax like
{code:sql}
ALTER TABLE [ IF EXISTS ] <name> SET
[ COMMENT = '<string_literal>' ]{code}
Apart from them Clickhouse[3] does it this way
{code:sql}
ALTER TABLE [db].name [ON CLUSTER cluster] MODIFY COMMENT 'Comment'{code}
Vertica[4] Teradata[5] and DuckDB[6] do that in completely different way
{code:sql}
COMMENT ON TABLE test_table IS 'very nice table';{code}
Also it would make sense to note that probably same feature should be added for
views as well.
[1] [https://dev.mysql.com/doc/refman/8.4/en/alter-table.html]
[2] [https://docs.snowflake.com/en/sql-reference/sql/alter-table-event-table]
[3]
[https://clickhouse.com/docs/en/sql-reference/statements/alter/commenthttps://docs.vertica.com/24.1.x/en/sql-reference/statements/comment-on-statements/comment-on-column/|https://clickhouse.com/docs/en/sql-reference/statements/alter/comment]
[4]
https://docs.vertica.com/24.1.x/en/sql-reference/statements/comment-on-statements/comment-on-column/
[5]
[https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/SQL-Data-Definition-Language-Syntax-and-Examples/Triggers-Statements/RENAME-TRIGGER/Related-Information]
[6] [https://duckdb.org/docs/sql/statements/comment_on]
> Add support for Table Comments in Flink SQL ALTER TABLE statements
> ------------------------------------------------------------------
>
> Key: FLINK-36098
> URL: https://issues.apache.org/jira/browse/FLINK-36098
> Project: Flink
> Issue Type: Improvement
> Reporter: Steffen Hoellinger
> Priority: Major
>
> Table Comments should be changeable via the ALTER Statements Syntax in Flink
> SQL:
> {code:java}
> ALTER TABLE my_table COMMENT 'New comment for my_table' {code}
>
> Table Comments can already be created with CREATE Statements such as the
> following:
> {code:java}
> CREATE TABLE (columns) COMMENT 'table_comment' {code}
>
> There currently seems no way to change table comments once created except for
> using the [Create or] Replace Table Statement :
> {code:java}
> REPLACE TABLE target_table
> COMMENT 'changed table_comment'
> WITH ()
> AS SELECT * FROM source_table; {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)