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


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/compaction/IcebergMajorQueryCompactor.java:
##########
@@ -63,20 +63,33 @@ public boolean run(CompactorContext context) throws 
IOException, HiveException,
 
     HiveConf conf = new HiveConf(context.getConf());
     String partSpec = context.getCompactionInfo().partName;
+    org.apache.hadoop.hive.ql.metadata.Table table = 
Hive.get(conf).getTable(context.getTable().getDbName(),
+        context.getTable().getTableName());
+    Table icebergTable = IcebergTableUtil.getTable(conf, table.getTTable());
     String compactionQuery;
 
     if (partSpec == null) {
-      HiveConf.setVar(conf, ConfVars.REWRITE_POLICY, 
RewritePolicy.ALL_PARTITIONS.name());
-      compactionQuery = String.format("insert overwrite table %s select * from 
%<s", compactTableName);
+      if (!IcebergTableUtil.isPartitioned(icebergTable)) {
+        HiveConf.setVar(conf, ConfVars.REWRITE_POLICY, 
RewritePolicy.ALL_PARTITIONS.name());

Review Comment:
   if table is unpartitioned, why policy is RewritePolicy.ALL_PARTITIONS?



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