filter动态分区

qni6mghb  于 2021-06-26  发布在  Hive
关注(0)|答案(0)|浏览(200)

试图创建一个配置单元表,但由于文件夹结构的原因,仅仅分区就需要几个小时。
下面是我目前用来创建表的一个例子,但是如果我可以过滤分区的话,这将非常有帮助。
在下面的表格中,我需要每个孩子的公司,只要一年,每个月,和一种类型的报告。
有什么办法可以像这样做吗 set hcat.dynamic.partitioning.custom.pattern = '${child_company}/year=${2016}/${month}/report=${inventory}'; 在分区时避免读取所有文件夹(>300k)? Language: Hive Version: 1.2 Interface: Quobole ```
use my_database;

set hcat.dynamic.partitioning.custom.pattern = '${child_company}/${year}/${month}/${report}';

drop table if exists table_1;

create external table table_1
(
Date_Date string,
Product string,
Quantity int,
Cost int
)
partitioned by
(
child_company string,
year int,
month int,
report string
)

row format delimited fields terminated by '\t'
lines terminated by '\n'
location 's3://mycompany-myreports/parent/partner_company-12345';

alter table table_1 recover partitions;
show partitions table_1;

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题