Using multiple levels of partitions in Hive

时光毁灭记忆、已成空白 提交于 2019-12-11 14:28:40

问题


I am wondering if the following is possible. I have data in Hive partitioned by date and logger, but I also have data that does not fall under a particular logger.

e.g.

date=2012-01-01/logger=1/part000
date=2012-01-01/logger=1/part001
date=2012-01-01/logger=2/part000
date=2012-01-01/logger=2/part001
date=2012-01-01/part000

I created my table with:

create table mytable (
    ...
)
partitioned by (date string, logger int)
....
;

and added partitions:

alter table mytable add partition (date='2012-01-01', logger=1) location '/user/me/date=2012-01-01/logger=1/';
...

I can query data in the partitions, but I cannot query data in the file date=2012-01-01/part000. Is it possible to include this file without it conforming to the partitioning?

Thank you


回答1:


Aaron, how did you manage to obtain such structure? Usually if partition key is missing HIVE creates partition called __HIVE_DEFAULT_PARTITION__.



来源:https://stackoverflow.com/questions/15077046/using-multiple-levels-of-partitions-in-hive

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!