You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "InvisibleProgrammer (via GitHub)" <gi...@apache.org> on 2023/05/08 17:24:28 UTC

[GitHub] [hive] InvisibleProgrammer commented on a diff in pull request #4301: HIVE-27327 : Iceberg basic stats: Incorrect row count in snapshot sum…

InvisibleProgrammer commented on code in PR #4301:
URL: https://github.com/apache/hive/pull/4301#discussion_r1187686934


##########
iceberg/iceberg-handler/src/test/queries/positive/row_count.q:
##########
@@ -0,0 +1,42 @@
+drop table llap_orders;

Review Comment:
   I'm not 100% sure but maybe there can be an edge case when the table is not cleaned up properly. In that case, I would consider using `DROP TABLE IF EXISTS...`



##########
iceberg/iceberg-handler/src/test/results/positive/row_count.q.out:
##########
@@ -0,0 +1,302 @@
+PREHOOK: query: drop table llap_orders

Review Comment:
   Please mask out the values that can change frequently, like `current-snapshot-id`, `added-files-size`, etc... 



##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -346,7 +346,16 @@ public Map<String, String> getBasicStatistics(Partish partish) {
               stats.put(StatsSetupConst.NUM_FILES, summary.get(SnapshotSummary.TOTAL_DATA_FILES_PROP));
             }
             if (summary.containsKey(SnapshotSummary.TOTAL_RECORDS_PROP)) {
-              stats.put(StatsSetupConst.ROW_COUNT, summary.get(SnapshotSummary.TOTAL_RECORDS_PROP));
+              long totalRecords = Long.parseLong(summary.get(SnapshotSummary.TOTAL_RECORDS_PROP));
+              if (summary.containsKey(SnapshotSummary.TOTAL_EQ_DELETES_PROP) &&

Review Comment:
   What if onlye one of `TOTAL_EQ_DELETES_PROP` and `TOTAL_POS_DELETES_PROP` persists?



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org