[ https://issues.apache.org/jira/browse/HIVE-27007?focusedWorklogId=843384&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-843384 ]
ASF GitHub Bot logged work on HIVE-27007: ----------------------------------------- Author: ASF GitHub Bot Created on: 03/Feb/23 06:40 Start Date: 03/Feb/23 06:40 Worklog Time Spent: 10m Work Description: 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 Issue Time Tracking ------------------- Worklog Id: (was: 843384) Time Spent: 3h (was: 2h 50m) > Iceberg: Use BasicStats from iceberg table's currrentSnapshot.summary() for > query planning > ------------------------------------------------------------------------------------------ > > Key: HIVE-27007 > URL: https://issues.apache.org/jira/browse/HIVE-27007 > Project: Hive > Issue Type: Improvement > Reporter: Simhadri Govindappa > Assignee: Simhadri Govindappa > Priority: Major > Labels: pull-request-available > Time Spent: 3h > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.20.10#820010)