[ 
https://issues.apache.org/jira/browse/HIVE-27007?focusedWorklogId=843374&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-843374
 ]

ASF GitHub Bot logged work on HIVE-27007:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Feb/23 05:00
            Start Date: 03/Feb/23 05:00
    Worklog Time Spent: 10m 
      Work Description: kasakrisz commented on code in PR #4000:
URL: https://github.com/apache/hive/pull/4000#discussion_r1095356638


##########
iceberg/iceberg-handler/src/test/results/positive/use_basic_stats_from_iceberg.q.out:
##########
@@ -0,0 +1,162 @@
+PREHOOK: query: drop table if exists tbl_ice
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table if exists tbl_ice
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: create external table tbl_ice(a int, b string, c int) stored 
by iceberg tblproperties ('format-version'='2')
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@tbl_ice
+POSTHOOK: query: create external table tbl_ice(a int, b string, c int) stored 
by iceberg tblproperties ('format-version'='2')
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@tbl_ice
+PREHOOK: query: select count(*) from tbl_ice
+PREHOOK: type: QUERY
+PREHOOK: Input: default@tbl_ice
+PREHOOK: Output: hdfs://### HDFS PATH ###
+POSTHOOK: query: select count(*) from tbl_ice
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@tbl_ice
+POSTHOOK: Output: hdfs://### HDFS PATH ###
+0
+PREHOOK: query: insert into tbl_ice values (1, 'one', 50), (2, 'two', 51),(2, 
'two', 51),(2, 'two', 51), (3, 'three', 52), (4, 'four', 53), (5, 'five', 54), 
(111, 'one', 55), (333, 'two', 56)
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@tbl_ice
+POSTHOOK: query: insert into tbl_ice values (1, 'one', 50), (2, 'two', 51),(2, 
'two', 51),(2, 'two', 51), (3, 'three', 52), (4, 'four', 53), (5, 'five', 54), 
(111, 'one', 55), (333, 'two', 56)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@tbl_ice
+PREHOOK: query: explain select * from tbl_ice order by a, b, c
+PREHOOK: type: QUERY
+PREHOOK: Input: default@tbl_ice
+PREHOOK: Output: hdfs://### HDFS PATH ###
+POSTHOOK: query: explain select * from tbl_ice order by a, b, c
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@tbl_ice
+POSTHOOK: Output: hdfs://### HDFS PATH ###
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Reducer 2 <- Map 1 (SIMPLE_EDGE)
+
+Stage-0
+  Fetch Operator
+    limit:-1
+    Stage-1
+      Reducer 2 vectorized
+      File Output Operator [FS_8]
+        Select Operator [SEL_7] (rows=9 width=95)

Review Comment:
   Please add an other test case when joining empty tables or at least one of 
the tables are empty.



##########
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:
   Does it mean that an empty table has no stats?





Issue Time Tracking
-------------------

    Worklog Id:     (was: 843374)
    Time Spent: 2h 50m  (was: 2h 40m)

> 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: 2h 50m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to