Hive
  1. Hive
  2. HIVE-3456

No apparent way to change table-level COMMENT data

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Not A Problem
    • Affects Version/s: 0.7.0, 0.7.1, 0.8.0, 0.8.1, 0.9.0
    • Fix Version/s: None
    • Component/s: Documentation, Metastore
    • Labels:
      None

      Description

      Not sure if this is a documentation issue, or a feature that is lacking from ALTER TABLE...

      Setting a COMMENT on a table during initial creation is straightforward.
      Changing column names and column comments is also straightforward using ALTER TABLE CHANGE...
      However, I have found no way, other than manually editing the metadata to set/change the table-level comment for a table after it has been created.

        Activity

        Hide
        Richard Nadeau added a comment -

        Looks like this works:

        ALTER TABLE test_table SET TBLPROPERTIES ('comment'='This is a test table.');

        Documentation:

        https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-AlterTableProperties

        Oddly though, Hive will lowercase the table comment at table creation time, but "COMMENT" and "comment" are handled as two different property names when using SET TBLPROPERTIES, so you could end up with this:

        parameters:

        {last_modified_by=joe, last_modified_time=1348701745, COMMENT=This is apparently the *wrong* comment., transient_lastDdlTime=1348701745, comment=This is apparently the *right* comment.}
        Show
        Richard Nadeau added a comment - Looks like this works: ALTER TABLE test_table SET TBLPROPERTIES ('comment'='This is a test table.'); Documentation: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-AlterTableProperties Oddly though, Hive will lowercase the table comment at table creation time, but "COMMENT" and "comment" are handled as two different property names when using SET TBLPROPERTIES, so you could end up with this: parameters: {last_modified_by=joe, last_modified_time=1348701745, COMMENT=This is apparently the *wrong* comment., transient_lastDdlTime=1348701745, comment=This is apparently the *right* comment.}
        Hide
        Ryan Harris added a comment -

        that is perfect thanks!

        Show
        Ryan Harris added a comment - that is perfect thanks!

          People

          • Assignee:
            Unassigned
            Reporter:
            Ryan Harris
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development