singhpk234 commented on a change in pull request #4456:
URL: https://github.com/apache/iceberg/pull/4456#discussion_r840845799
##########
File path:
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveTableOperations.java
##########
@@ -402,9 +404,27 @@ private void setHmsTableParameters(String
newMetadataLocation, Table tbl, TableM
parameters.put(StatsSetupConst.TOTAL_SIZE,
summary.get(SnapshotSummary.TOTAL_FILE_SIZE_PROP));
}
+ setSnapshotStats(metadata, parameters);
+
tbl.setParameters(parameters);
}
+ private void setSnapshotStats(TableMetadata metadata, Map<String, String>
parameters) {
+ Snapshot currentSnapshot = metadata.currentSnapshot();
+ if (currentSnapshot != null) {
+ parameters.put(TableProperties.CURRENT_SNAPSHOT_ID,
String.valueOf(currentSnapshot.snapshotId()));
+ parameters.put(TableProperties.CURRENT_SNAPSHOT_TIMESTAMP,
String.valueOf(currentSnapshot.timestampMillis()));
+ try {
+ parameters.put(TableProperties.CURRENT_SNAPSHOT_SUMMARY,
+ JsonUtil.mapper().writeValueAsString(currentSnapshot.summary()));
Review comment:
[question] should we take size of summary, also into consideration, As
if when we should keep it or is it always optimal to keep it ?
As per my understanding and I may be wrong here, The scenario I have in mind
(not sure how practical it is), If some one want's to track changed partition
metrics in summary and snapshot had a lot of changed partition and we set
`CHANGED_PARTITION_COUNT_PROP` to a high value, In this scenario the json size
could be very large, which is okayish to keep in File, but in DB I am not sure.
Your thoughts ?
https://github.com/apache/iceberg/blob/86b42fe966c0e0786379cb22c0c78905468f459b/core/src/main/java/org/apache/iceberg/SnapshotSummary.java#L183-L190
--
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]