sambavim requested code review of "
HIVE-2908 [jira] Hive: Extend ALTER TABLE DROP PARTITION syntax to use all comparators".
This diff introduces drop partition with non-equality comparisons
on the partition key. You can now issue commands of the form:
alter table <tbl> drop partition (key<value)
to drop all partitions which satisfy the predicate.
Changes were introduced to hive.g to allow the new operators:
<, >, <>, !=, <=, >=
in alter table drop partition statements.
The change is implemented by using the method getPartitionsByFilter on
the Hive object. In order to cleanup the passing around of the partition
spec information, I introduced a new class called PartitionSpec which
encapsulates one complete partition spec (multiple key value comparisons).
The drop statement thus has a list of the PartitionSpec objects.
Unit tests have been added to test the new functionality. Some existing
test results needed an update due to the change in the AST for the
All unit tests passed with this change. The test results of the escape1.q
test need an update as well but arc diff complains since it concludes the file
is binary. I will work with the committer to make sure that change is captured
To drop a partition from a Hive table, this works:
ALTER TABLE foo DROP PARTITION(ds = 'date')
...but it should also work to drop all partitions prior to date.
ALTER TABLE foo DROP PARTITION(ds < 'date')
This task is to implement ALTER TABLE DROP PARTITION for all of the comparators, < > <= >= <> = != instead of just for =.
MANAGE HERALD DIFFERENTIAL RULES
WHY DID I GET THIS EMAIL?
Tip: use the X-Herald-Rules header to filter Herald messages in your client.