Aggarwal-Raghav commented on code in PR #6235:
URL: https://github.com/apache/hive/pull/6235#discussion_r2628131470
##########
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:
In older
`iceberg/iceberg-handler/src/main/java/org/apache/iceberg/data/PartitionStatsHandler.java`
When file format was ORC, we were using AVRO based stats and now we will start
using Parquet (DEFAULT_FILE_FORMAT_DEFAULT).
Question:
For iceberg table created with 1.9.1 having some pre-existing data, we have
stats based on AVRO and after upgrading to iceberg 1.10.0, the new data will
have the new incremental stats file based on AVRO + Parquet. Is my
understanding correct?
--
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]