deniskuzZ commented on code in PR #5261:
URL: https://github.com/apache/hive/pull/5261#discussion_r1614744252
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -498,30 +501,58 @@ public boolean
canSetColStatistics(org.apache.hadoop.hive.ql.metadata.Table hmsT
@Override
public boolean setColStatistics(org.apache.hadoop.hive.ql.metadata.Table
hmsTable, List<ColumnStatistics> colStats) {
Table tbl = IcebergTableUtil.getTable(conf, hmsTable.getTTable());
- String snapshotId = String.format("%s-STATS-%d", tbl.name(),
tbl.currentSnapshot().snapshotId());
- return writeColStats(colStats.get(0), tbl, snapshotId);
+ return writeColStats(colStats.get(0), tbl);
}
- private boolean writeColStats(ColumnStatistics tableColStats, Table tbl,
String snapshotId) {
+ private boolean writeColStats(ColumnStatistics tableColStats, Table tbl) {
try {
- boolean rewriteStats = removeColStatsIfExists(tbl);
- if (!rewriteStats) {
+ if (!shouldRewriteColStats(tbl)) {
checkAndMergeColStats(tableColStats, tbl);
}
// Currently, we are only serializing table level stats.
byte[] serializeColStats = SerializationUtils.serialize(tableColStats);
- try (PuffinWriter writer =
Puffin.write(tbl.io().newOutputFile(getColStatsPath(tbl).toString()))
+ StatisticsFile statisticsFile;
+ String statsPath = tbl.location() + STATS + UUID.randomUUID();
Review Comment:
we can, however, none of the other data files provide this information
--
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]