Hive 分区恢复

标签 hive hdfs hql hadoop-partitioning

如何以简单的方式恢复分区。这是场景:

  1. Have 'n' partitions on existing external table 't'
  2. Dropped table 't'
  3. Recreated table 't' // Note : same table but with excluding some column
  4. How to recover the 'n' partitions that existed for table 't' in step #1 ?

我可以通过编写一些脚本手动更改表以添加“n”分区。但这非常乏味。是否有内置的东西可以恢复这些分区?

最佳答案

当分区目录仍然存在于 HDFS 中时,只需运行以下命令:

MSCK REPAIR TABLE table_name;

它根据表目录中存在的内容将分区定义添加到元存储。

关于Hive 分区恢复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37452950/

相关文章:

hadoop - 如何使用Pig中的HCatlog对Hive Metastore使用压缩技术?

python - 与Hortonworks Ambari(Hive)的Python连接。

java - hibernate hql getMaxVersion

hibernate - JPA/HIBERNATE 处理非 POJO 实体

shell - 通过使用 shell 脚本过滤修改日期,将文件从 hdfs 文件夹复制到另一个 hdfs 位置

java - 寻找 HQL 构建器(Hibernate 查询语言)

hadoop - 从Beefline转储HDFS目录中的数据

hadoop - Hive数据库或表无法创建,我刚刚配置了centOS 6.4 VM并安装了Hive

file - HDFS 文件何时可见

java - 无法从集群网络外部的 Java 应用程序获取 HDFS 集群中文件的 InputStream