Is it possible to change the metadata of a column that is on a partitioned table in Hive?

前端 未结 1 1129
谎友^
谎友^ 2021-01-25 07:35

This is an extension of a previous question I asked: Is it possible to change partition metadata in HIVE?

We are exploring the idea of changing the metadata on the table

相关标签:
1条回答
  • 2021-01-25 07:59

    You can easily change column type:

    Use alter table in Hive, change type to STRING, etc:

    alter table table_name change column col_name col_name string cascade; --change to string
    

    See documentation.

    ALTER TABLE CHANGE COLUMN with CASCADE command changes the columns of a table's metadata, and cascades the same change to all the partition metadata.

    Alternatively you can recreate table like in this answer: https://stackoverflow.com/a/58299056/2700344

    0 讨论(0)
提交回复
热议问题