博客信息

修改Hive表结构不更新元数据的问题

发布时间:『 2017-06-06 18:38』  博客类别:Hadoop/Spark  阅读(1410) 评论(0)

修改Hive表结构不更新元数据的问题

ALTER TABLE table_name 
  [PARTITION partition_spec]                 -- (Note: Hive 0.14.0 and later)
  ADD|REPLACE COLUMNS (col_name data_type [COMMENT col_comment], ...)
  [CASCADE|RESTRICT]                         -- (Note: Hive 1.1.0 and later)
The CASCADE|RESTRICT clause is available in Hive 1.1.0. ALTER TABLE ADD|REPLACE COLUMNS with CASCADE command changes the columns of a table's metadata, and cascades the same change to all the partition metadata. RESTRICT is the default, limiting column changes only to table metadata.

以上是官方说明。

在alter语句后面加上CASCADE即可使更新表结构后,刷新分区的元数据。

关键字:   元数据  
评论信息
暂无评论
发表评论
验证码: 
Powered by IMZHANGJIE.CN Copyright © 2015-2025 粤ICP备14056181号