simhadri-g commented on code in PR #4000:
URL: https://github.com/apache/hive/pull/4000#discussion_r1095405415
##########
ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUtils.java:
##########
@@ -454,6 +468,27 @@ private static Statistics collectStatistics(HiveConf conf,
PrunedPartitionList p
return stats;
}
+ private static Map<String, Long> getValidBasicStatsFromStorageHandler(Table
table) {
+
+ Map<String, String> storageHandlerBasicStatsMap =
+ (table.isNonNative() &&
table.getStorageHandler().canProvideBasicStatistics()) ?
table.getStorageHandler()
+ .getBasicStatistics(Partish.buildFor(table)) : null;
+
+ try {
+ if (storageHandlerBasicStatsMap != null &&
+
Long.parseLong(storageHandlerBasicStatsMap.get(StatsSetupConst.ROW_COUNT)) > 0)
{
Review Comment:
Yes, snapshots are not created for a new table until data is inserted. As a
result, stats are not available.
The following line turns out to be null for the new table.
` if (table.currentSnapshot() != null) `
https://github.com/apache/hive/blob/master/iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java#L316
--
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]