deniskuzZ commented on code in PR #5248:
URL: https://github.com/apache/hive/pull/5248#discussion_r1644508741


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/compaction/IcebergMajorQueryCompactor.java:
##########
@@ -68,7 +86,43 @@ public boolean run(CompactorContext context) throws 
IOException, HiveException,
       Map<String, String> partSpecMap = new LinkedHashMap<>();
       Warehouse.makeSpecFromName(partSpecMap, new Path(partSpec), null);
 
-      List<FieldSchema> partitionKeys = 
table.getStorageHandler().getPartitionKeys(table);
+      Table icebergTable = IcebergTableUtil.getTable(conf, table.getTTable());
+      Expression expression = 
IcebergTableUtil.generateExpressionFromPartitionSpec(icebergTable, partSpecMap);
+      PartitionsTable partitionsTable = (PartitionsTable) MetadataTableUtils
+          .createMetadataTableInstance(icebergTable, 
MetadataTableType.PARTITIONS);
+      List<Pair<PartitionData, Integer>> partitionList = Lists.newArrayList();
+      try (CloseableIterable<FileScanTask> fileScanTasks = 
partitionsTable.newScan().planFiles()) {
+        fileScanTasks.forEach(task ->
+            
partitionList.addAll(Sets.newHashSet(CloseableIterable.transform(task.asDataTask().rows(),
 row -> {

Review Comment:
   I mean HashSet object type would be Pair. why do you need HashSet? why not 
use HashMap



-- 
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]

Reply via email to