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


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -247,6 +248,11 @@ public class HiveIcebergStorageHandler extends 
DefaultStorageHandler implements
 
   private static final List<FieldSchema> DV_DISTRIBUTION = 
schema(ImmutableList.of(FILE_PATH));
 
+  // Iceberg cannot evaluate these virtual columns, so a predicate that reads 
one of them is not pushed down
+  private static final Set<String> NON_PUSHABLE_VIRTUAL_COLS = Stream.of(

Review Comment:
   Done, thanks.  Added `VirtualColumn.readsVirtualColumn(ExprNodeDesc)`, which 
checks `VIRTUAL_COLUMN_NAME_MAP`, so every virtual column counts. The local 
list in `HiveIcebergStorageHandler` is gone. `decomposePredicate` and 
`DeleteSemanticAnalyzer#filtersOnVirtualColumn` both use the helper now, so 
they follow the same rule.
   
   This also fixes a real gap. The old list (and `VIRTUAL_COLUMN_NAMES`) did 
not include `SNAPSHOT__ID`. On the previous revision both of these failed at 
split planning:
   
       select a from ice_vc where a = 1 or  snapshot__id is not null;
       select a from ice_vc where a = 1 and snapshot__id is not null;
   
       ValidationException: Cannot find field 'SNAPSHOT__ID' in struct: 
struct<1: a: optional int>
         at BaseScan.lazyColumnProjection / SnapshotScan.planFiles
   
   The MV incremental rebuild is not affected: `HivePushdownSnapshotFilterRule` 
replaces its `SNAPSHOT__ID <= x` predicate with `true` before the predicate is 
decomposed. All `mv_iceberg_*` qtests pass.



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