gpt4 book ai didi

hadoop - 是否可以在 Hive 中导出多个分区

转载 作者:可可西里 更新时间:2023-11-01 16:52:59 26 4
gpt4 key购买 nike


是否可以在一次 EXPORT 中从一张表中导出多个分区?

Documentation说:

EXPORT TABLE tablename [PARTITION (part_column="value"[, ...])]
TO 'export_target_path'

我想 [, ...] 意味着额外的分区列:part_column1="value", part_column2="value" 不是同一分区列的不同值.

是否可以使用具有多个值的一列?我的意思是这样的:part_column1 = "value1","value2"part_column1 = "value1", part_column1 = "value2"

[编辑]我的例子是:

hive (pr)> export table account partition (start_date="2015-06-23",start_date="2015-06-22") to 'accounts';
Copying data from file:/tmp/hive_2015-07-02_17-40-50_937_3732031090994168422-1/-local-10000/_metadata
Copying file: file:/tmp/hive_2015-07-02_17-40-50_937_3732031090994168422-1/-local-10000/_metadata
Copying data from hdfs://server.pl:8020/apps/hive/warehouse/pr.db/account/start_date=2015-06-22
Copying file: hdfs://server.pl:8020/apps/hive/warehouse/pr.db/account/start_date=2015-06-22/000000_0
Copying file: hdfs://server.pl:8020/apps/hive/warehouse/pr.db/account/start_date=2015-06-22/000001_0
Copying file: hdfs://server.pl:8020/apps/hive/warehouse/pr.db/account/start_date=2015-06-22/000002_0
OK
Time taken: 20.69 seconds

所以我想导出两个分区:start_date="2015-06-23",start_date="2015-06-22"并且只导出分区start_date="2015-06-22"

帕维尔

最佳答案

从 Hive 0.14 开始,您不能这样做。尝试指定 2 个分区将在目标目录中仅创建一个文件夹,其中包含来自一个分区的数据。

关于hadoop - 是否可以在 Hive 中导出多个分区,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31186805/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com