【发布时间】:2017-09-17 10:57:10
【问题描述】:
我在 hive 中有一个按年、月、日分区的外部表。所以我删除了一个分区,但我仍然在显示分区中看到它。
>use test_raw_tables;
>show partitions test1_raw;
[year=2016/month=01/day=01]
[year=2017/month=03/day=24]
> alter table test1_raw drop partition (year=2016, month=01, day=01);
> refresh test1_raw;
> show partitions test1_raw;
[year=2016/month=01/day=01]
[year=2017/month=03/day=24] ---Still see the dropped partition here----
> msck repair table test1_raw;
> show partitions test1_raw;
[year=2016/month=01/day=01]
[year=2017/month=03/day=24] ---Still see the dropped partition here----
以 hive 作为引擎从 impala 运行。
描述 test1_raw col_name,data_type,comment ('amount_hold', 'int', '') ('id', 'int', '') ('transaction_id', 'string', '') ('recipient_id', 'string', '') ('year', 'string', '') ('month', 'string', '') ('day', 'string', '') ('', None, None) ('#分区信息', None, None) ('# col_name', 'data_type', 'comment') ('', None, None) ('year', 'string', '') ('month', 'string' , '') ('day', 'string', '') 位置 'hdfs://localhost/sys/datalake/testing/test1_raw'
这里有什么问题? 删除该分区后,该分区的 hdfs 中的数据将被删除。无法解决问题。
【问题讨论】:
-
(1) 请添加表定义 (2) 您从哪里运行代码?黑斑羚壳?蜂巢?直线?
-
@DuduMarkovitz 表是一个外部表。从 hive shell 运行查询。
-
refresh是 Impala 命令,而不是 hive。我需要知道你在哪里执行什么以及表定义,包括相关的分区定义。还请告诉我他们的路径在文件系统中的样子。 -
请把这个以及相关分区的路径添加到帖子中