ayushtkn commented on code in PR #5261:
URL: https://github.com/apache/hive/pull/5261#discussion_r1615319244


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/IcebergTableUtil.java:
##########
@@ -133,6 +135,20 @@ static Table getTable(Configuration configuration, 
Properties properties) {
     return getTable(configuration, properties, false);
   }
 
+  static Optional<Path> getColStatsPath(Table table) {
+    return getColStatsPath(table, table.currentSnapshot().snapshotId());
+  }
+
+  static Optional<Path> getColStatsPath(Table table, long snapshotId) {
+    return table.statisticsFiles().stream()
+      .filter(stats -> stats.snapshotId() == snapshotId)
+      .filter(stats -> stats.blobMetadata().stream()
+        .anyMatch(metadata -> 
ColumnStatisticsObj.class.getSimpleName().equals(metadata.type()))

Review Comment:
   We did set created-by Hive while creating the Puffin file(` 
.createdBy(Constants.HIVE_ENGINE).build()``), is there a possibility to check 
that here as well, that the Stats file that we are consuming is Hive written 
only?



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