difin commented on code in PR #5792:
URL: https://github.com/apache/hive/pull/5792#discussion_r2087311018


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/compaction/IcebergQueryCompactor.java:
##########
@@ -96,16 +106,46 @@ public boolean run(CompactorContext context) throws 
IOException, HiveException,
         throw new HiveException(ErrorMsg.COMPACTION_NO_PARTITION);
       }
     } else {
-      long partitionHash = IcebergTableUtil.getPartitionHash(icebergTable, 
partSpec);
+      Pair<Integer, StructProjection> partSpecPair =
+          IcebergTableUtil.getPartitionSpecIdAndStruct(icebergTable, partSpec);

Review Comment:
   Done, now not scanning `partitions` table anymore to get partition struct 
and spec id.
   The only thing I did differently is the condition on struct fields.
   instead of `where `partition` = 
named_struct('field1','value1','field2','value2')` I implemented 
   `where `partition`.`field1` = 'value1' and `partition`.`field2` = 'value2'
   
   because this is equivalent and the first variant doesn't work - the values 
in named_struct condition need to be of exact Iceberg types, it requires type 
casting, I bumped into cases where it was not evident which type to use.



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to