Index: ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java (revision 1370738) +++ ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java (working copy) @@ -1928,10 +1928,18 @@ boolean stringPartitionColumns = true; List partCols = tab.getPartCols(); - for (FieldSchema partCol : partCols) { - if (!partCol.getType().toLowerCase().equals("string")) { - stringPartitionColumns = false; - break; + for (PartitionSpec partSpec : partSpecs) { + Map partialSpec = partSpec.getPartSpecWithoutOperator(); + for (FieldSchema partCol : partCols) { + boolean isPartColExist = true; + if (partialSpec.containsKey(partCol.getName())) + { + isPartColExist = false; + } + if (!isPartColExist && !partCol.getType().equalsIgnoreCase("string")) { + stringPartitionColumns = false; + break; + } } } Index: ql/src/test/queries/clientpositive/drop_partitions_filter3.q =================================================================== --- ql/src/test/queries/clientpositive/drop_partitions_filter3.q (revision 1370738) +++ ql/src/test/queries/clientpositive/drop_partitions_filter3.q (working copy) @@ -15,6 +15,9 @@ alter table ptestfilter drop partition (c='2'); show partitions ptestfilter; +alter table ptestfilter drop partition (c<'2'); +show partitions ptestfilter; + drop table ptestfilter; Index: ql/src/test/results/clientpositive/drop_partitions_filter3.q.out =================================================================== --- ql/src/test/results/clientpositive/drop_partitions_filter3.q.out (revision 1370738) +++ ql/src/test/results/clientpositive/drop_partitions_filter3.q.out (working copy) @@ -97,6 +97,20 @@ c=1/d=2 c=3/d=1 c=3/d=2 +PREHOOK: query: alter table ptestfilter drop partition (c<'2') +PREHOOK: type: ALTERTABLE_DROPPARTS +PREHOOK: Input: default@ptestfilter +PREHOOK: Output: default@ptestfilter@c=1/d=2 +POSTHOOK: query: alter table ptestfilter drop partition (c<'2') +POSTHOOK: type: ALTERTABLE_DROPPARTS +POSTHOOK: Input: default@ptestfilter +POSTHOOK: Output: default@ptestfilter@c=1/d=2 +PREHOOK: query: show partitions ptestfilter +PREHOOK: type: SHOWPARTITIONS +POSTHOOK: query: show partitions ptestfilter +POSTHOOK: type: SHOWPARTITIONS +c=3/d=1 +c=3/d=2 PREHOOK: query: drop table ptestfilter PREHOOK: type: DROPTABLE PREHOOK: Input: default@ptestfilter