zratkai commented on code in PR #5483:
URL: https://github.com/apache/hive/pull/5483#discussion_r1799549206
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/ppr/PartitionPruner.java:
##########
@@ -139,6 +139,20 @@ public static boolean onlyContainsPartnCols(Table tab,
ExprNodeDesc expr) {
return true;
}
+ public static boolean isPartitioned(Table table){
+ if (table.getStorageHandler() != null &&
table.getStorageHandler().alwaysUnpartitioned()) {
+ return table.getStorageHandler().isPartitioned(table);
+ } else {
+ return table.isPartitioned();
+ }
+ }
+
+ public static boolean isPartitionKey(Table table, String columnName){
+ final String lowerCaseColumnName = columnName.toLowerCase();
+ List<FieldSchema> partitionKeys = table.getStorageHandler() != null &&
table.getStorageHandler().alwaysUnpartitioned() ?
+ table.getStorageHandler().getPartitionKeys(table) :
table.getPartCols();
+ return
partitionKeys.stream().filter(item->item.getName().toLowerCase().equals(lowerCaseColumnName)).findFirst().isPresent();
Review Comment:
Fixed.
##########
iceberg/iceberg-handler/src/test/queries/negative/iceberg_major_compaction_with_non_partition_column_in_filter.q:
##########
@@ -0,0 +1,11 @@
+set hive.llap.io.enabled=true;
+set hive.vectorized.execution.enabled=true;
+set hive.optimize.shared.work.merge.ts.schema=true;
+
+create table iceberg_orc_compaction (a int, b int, c string) partitioned by (d
int) stored by iceberg stored as orc;
+
+insert into iceberg_orc_compaction values (1, 11, "text1",
111),(2,22,"text2",222);
+insert into iceberg_orc_compaction values (3, 33, "text3",
333),(4,44,"text4",444);
+insert into iceberg_orc_compaction values (5, 55, "text5",
555),(6,66,"text6",666);
+
+alter table iceberg_orc_compaction COMPACT 'major' and wait where (c in
('text1', 'text2'));
Review Comment:
Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]