Reputation: 231
I Have table with dynamic partition "campaign" and static partitions year and month(that means I am giving there value while inserting/creating partitions).
'ABC' Partition by (year='2011', month='08', campaign)
As dynamic partition is only supported when its followed by static partitions namesly year and month. But my use case is opposite
I want something like this --> 'ABC' Partition by (campaign, year='2011', month='08')
So that i can see for campaigns results per year and month.
By any chance, OR any other option by which I can do that? something like this??
ALTER TABLE ABC PARTITION (y='2011', m='08',campaign) RENAME/ALTER PARTITIONs (campaign,y='2011', m='08');
Upvotes: 1
Views: 1385
Reputation: 682
if you set your partition to strict
mode you can perform it
SET hive.exec.dynamic.partition=strict
BUT IF you set to nonstrict mode and perform dynamically then
SET hive.exec.dynamic.partition=nonstrict
We cannot perform ALTER
on the Dynamic partition.
Upvotes: 1
Reputation: 2378
A partition isn't defined as static or dynamic in the metastore; Just INSERT/LOAD queries define partitions as static or dynamic. You can run an insertion that uses all-dynamic partitions by using SET hive.exec.dynamic.partition=nonstrict
.
See: https://cwiki.apache.org/confluence/display/Hive/Tutorial
Upvotes: 2