hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Evan Pollan <>
Subject Partition deletion w/out using a literal partition value
Date Sun, 05 Feb 2012 22:10:22 GMT
I have an environment where I'm partitioning data in some hive tables by day.  I'd like to
be able to delete data that's older than 1 week in some tables and 1 month in others.  It
appears that ALTER TABLE <t> DROP PARTITION only supports a partition spec that equates
a partition with a literal value.

I must be missing something obvious — how would I delete partitions that meet some criteria,
rather than partitions that I'm able to reference via literal value?  The only way I can think
of doing this is by first running a hive query to get all partitions that should be deleted,
then constructing a series of ALTER TABLE DROP PARTITION statements, each with a literal corresponding
to one of the PARTITIONS, and executing those in a second phase.

I'd like to be able to do this all within one HQL script…



View raw message