Aggarwal-Raghav commented on code in PR #6235:
URL: https://github.com/apache/hive/pull/6235#discussion_r2629624605


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -535,7 +536,19 @@ public Map<String, String> computeBasicStatistics(Partish 
partish) {
       PartitionStatisticsFile statsFile = 
IcebergTableUtil.getPartitionStatsFile(table, snapshot.snapshotId());
       if (statsFile == null) {
         try {
-          statsFile = PartitionStatsHandler.computeAndWriteStatsFile(table);
+          Table statsTable = table;
+          if (FileFormat.ORC == IcebergTableUtil.defaultFileFormat(table)) {
+            // PartitionStatsHandler uses the table default file format for 
writing the stats file.
+            // ORC is not supported by InternalData writers, so we create an 
uncommitted transaction
+            // view of the table without DEFAULT_FILE_FORMAT to fall back to 
DEFAULT_FILE_FORMAT_DEFAULT.
+            // NOTE: we intentionally do not call commitTransaction(), so this 
property change is never published.
+            Transaction tx = table.newTransaction();
+            tx.updateProperties()
+                .remove(TableProperties.DEFAULT_FILE_FORMAT)

Review Comment:
   Post rewrite_data_files / compaction, i think it should be ok.



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