deniskuzZ commented on code in PR #6990:
URL: https://github.com/apache/hive/pull/6990#discussion_r4738254767


##########
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:
   Every row has spec id 0, so each OR filter here is true for every row. One 
case where the virtual-column branch is false, e.g. a = 1 or 
partition__spec__id = 1, would also check that the right rows come back after 
reading every file, i.e. that the residual filter is still applied.



-- 
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]

Reply via email to