【Hive & Spark】修复分区

语法

MSCK REPAIR TABLE table_identifier [{ADD|DROP|SYNC} PARTITIONS]

msck repair table table_identifier 默认执行的是 add partitions操作


ref: spark.apache.org/docs

Syntax
MSCK REPAIR TABLE table_identifier [{ADD|DROP|SYNC} PARTITIONS]
Parameters
table_identifier

Specifies the name of the table to be repaired. The table name may be optionally qualified with a database name.

Syntax: [ database_name. ] table_name

{ADD|DROP|SYNC} PARTITIONS

Specifies how to recover partitions. If not specified, ADD is the default.

ADD, the command adds new partitions to the session catalog for all sub-folder in the base table folder that don’t belong to any table partitions.
DROP, the command drops all partitions from the session catalog that have non-existing locations in the file system.
SYNC is the combination of DROP and ADD.

posted @   梦醒江南·Infinite  阅读(305)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
点击右上角即可分享
微信分享提示