alec.tu
alec.tu

Reputation: 1757

How to select rows whose partition is HIVE_DEFAULT_PARTITION?

hive inserts the bad column or record into HIVE_DEFAULT_PARTITION if we use dynamic partition.

My question is how to select the records in HIVE_DEFAULT_PARTITION?

something like this, but this will not do the trick.

select * from my_table where useDay=HIVE_DEFAULT_PARTITION

Thank you!

Upvotes: 1

Views: 2546

Answers (1)

www
www

Reputation: 4391

Here is use case from my test tables:

hive> show partitions tt;
OK
p1=1/p2=a
p1=1/p2=b
p1=2/p2=c
p1=3/p2=__HIVE_DEFAULT_PARTITION__

hive> select * from tt where p1 = 3 and p2='__HIVE_DEFAULT_PARTITION__' ;
OK
3   NULL    NULL    3   __HIVE_DEFAULT_PARTITION__

GL!

Upvotes: 1

Related Questions