ggangadharan commented on code in PR #6990:
URL: https://github.com/apache/hive/pull/6990#discussion_r4740138928
##########
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergStorageHandler.java:
##########
@@ -228,4 +252,60 @@ public void
testGetSnapshotContextsReturnsEmptyIterableWhenGivenSnapshotNotInThe
assertThat(result.iterator().hasNext(), is(false));
}
+
+ @Test
+ public void testDecomposePredicateLeavesOutConjunctsReadingVirtualColumns()
throws UDFArgumentException {
+ ExprNodeGenericFuncDesc dataFilter = func(new GenericUDFOPEqual(),
DATA_COL, constant(1));
+ ExprNodeGenericFuncDesc filter = func(new GenericUDFOPAnd(), dataFilter,
func(new GenericUDFOPEqual(), SPEC_ID_COL,
+ constant(0)), func(new GenericUDFOPNotNull(), FILE_PATH_COL));
+
+ DecomposedPredicate decomposed = decompose(filter);
+ assertThat(decomposed.pushedPredicate.isSame(dataFilter), is(true));
+ assertThat(decomposed.residualPredicate, sameInstance(filter));
+
+ filter = func(new GenericUDFOPAnd(), func(new GenericUDFOPEqual(),
SPEC_ID_COL, constant(0)),
+ func(new GenericUDFOPNotNull(), FILE_PATH_COL));
+ assertThat(decompose(filter).pushedPredicate, is(nullValue()));
+ }
+
+ @Test
+ public void
testDecomposePredicatePushesNothingWhenOtherOperatorReadsVirtualColumn() throws
UDFArgumentException {
Review Comment:
Renamed to
`testDecomposePredicatePushesNothingForNonConjunctionReadingVirtualColumn`.
--
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]