deniskuzZ commented on code in PR #6990: URL: https://github.com/apache/hive/pull/6990#discussion_r4738205055
########## 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; +select a from ice_vc where a = 1 or a = 10 or partition__spec__id = 0 order by a; Review Comment: Could we cover SNAPSHOT__ID ```` select a from ice_vc where a = 1 or snapshot__id is not null order by a; select a from ice_vc where a = 1 and snapshot__id is not null order by a; ```` On the format-version 2 table, a metadata-delete check: `delete from ice_vc_del where a = 1 and snapshot__id = 0`; should leave both rows. A SNAPSHOT_ID case in `testDecomposePredicatePushesNothing`… would also help. -- 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]
