question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support to alter table comment

See original GitHub issue

I looking for a way to change the table comment. You can create a table with a comment

CREATE TABLE prod.db.sample (
    id bigint COMMENT 'unique id',
    data string)
USING iceberg

You can alter the comment of a column

ALTER TABLE prod.db.sample ALTER COLUMN measurement COMMENT 'unit is kilobytes per second'

But there does not appear to be a way to alter the tables comment.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
felixYyucommented, Apr 27, 2022

I will open a PR to add this to the Spark docs. @kbendick

0reactions
felixYyucommented, Apr 27, 2022

ALTER TABLE hadoop_prod.default.test_evolution7 SET TBLPROPERTIES (‘comment’ = ‘A table comment.’)

ALTER TABLE hadoop_prod.default.test_evolution7 ALTER COLUMN point COMMENT “new comment”

the syntax of Spark sql can work @kbendick . show DDL detail following:

+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|createtab_stmt                                                                                                                                                                                                                                                                                                                                                                                                                        |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|CREATE TABLE hadoop_prod.default.test_evolution7 (\n  `col0` BIGINT,\n  `col10` BIGINT,\n  `point` STRUCT<`x`: DOUBLE, `y`: DOUBLE> COMMENT 'new comment')\nUSING iceberg\nCOMMENT 'A table comment.'\nLOCATION 'file:///D:/lake-iceberg/warehouse/default/test_evolution7'\nTBLPROPERTIES(\n  'current-snapshot-id' = 'none',\n  'format' = 'iceberg/parquet',\n  'format-version' = '1',\n  'write.delete.mode' = 'merge-on-read')\n|
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Read more comments on GitHub >

github_iconTop Results From Across the Web

SQL to add column and comment in table in single command
Query to add column with comment are : alter table table_name add( " ...
Read more >
COMMENT
Use the COMMENT statement to add to the data dictionary a comment about a table or table column, view, materialized view, operator, indextype,...
Read more >
ALTER TABLE … MODIFY COMMENT | ClickHouse Docs
Adds, modifies, or removes comment to the table, regardless if it was set before or not. Comment change is reflected in both system.tables...
Read more >
13.1.9 ALTER TABLE Statement - MySQL :: Developer Zone
ALTER TABLE changes the structure of a table. For example, you can add or delete columns, create or destroy indexes, change the type...
Read more >
COMMENT - Snowflake Documentation
The COMMENT parameter can also be used in the ALTER <object> command to change an existing comment at any time. A slightly different...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found