ggangadharan commented on code in PR #6990:
URL: https://github.com/apache/hive/pull/6990#discussion_r4740142466
##########
iceberg/iceberg-handler/src/test/queries/positive/iceberg_virtual_column_pushdown.q:
##########
@@ -0,0 +1,65 @@
+-- The filter Hive pushes to an Iceberg table prunes its data files; a virtual
column cannot be evaluated there.
+-- Each insert writes one file, and RECORDS_IN_Map_1 counts the rows of the
files that were read.
+set hive.fetch.task.conversion=none;
+set hive.vectorized.execution.enabled=true;
+
+create external table ice_vc (a int) stored by iceberg stored as parquet;
+insert into ice_vc values (1), (2);
+insert into ice_vc values (10), (11);
+insert into ice_vc values (20), (21);
+
+explain cbo select a from ice_vc where a = 1 or file__path is not null;
+
+-- Group the splits into one task, so the counters below do not depend on the
slots available to the cluster
+set tez.grouping.split-count=1;
+set
hive.exec.post.hooks=org.apache.hadoop.hive.ql.hooks.PostExecTezSummaryPrinter;
+
+-- under OR: every row qualifies, so every file must be read
+select a from ice_vc where a = 1 or file__path is not null order by a;
+select a from ice_vc where a = 1 or partition__spec__id = 0 order by a;
Review Comment:
Added:
select a from ice_vc where a = 1 or partition__spec__id = 1 order by a;
It reads all 3 files (RECORDS_IN_Map_1: 6) and returns only row 1, so the
residual filter is still applied after the full read. `a = 1 or snapshot__id is
not null` checks the same thing for SNAPSHOT__ID, since it is NULL for every
row.
--
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]