jtuglu1 commented on code in PR #18953:
URL: https://github.com/apache/druid/pull/18953#discussion_r2740221976
##########
extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/IcebergInputSourceTest.java:
##########
@@ -215,6 +222,104 @@ public void testCaseInsensitiveFiltering() throws
IOException
Assert.assertEquals(1, localInputSourceList.size());
}
+ @Test
+ public void testResidualFilterModeIgnore() throws IOException
+ {
+ // Filter on non-partition column with IGNORE mode should succeed
+ IcebergInputSource inputSource = new IcebergInputSource(
+ TABLENAME,
+ NAMESPACE,
+ new IcebergEqualsFilter("id", "123988"),
+ testCatalog,
+ new LocalInputSourceFactory(),
+ null,
+ ResidualFilterMode.IGNORE
+ );
+ Stream<InputSplit<List<String>>> splits = inputSource.createSplits(null,
new MaxSizeSplitHintSpec(null, null));
+ Assert.assertEquals(1, splits.count());
+ }
+
+ @Test
+ public void testResidualFilterModeFail() throws IOException
+ {
+ // Filter on non-partition column with FAIL mode should throw exception
+ IcebergInputSource inputSource = new IcebergInputSource(
+ TABLENAME,
+ NAMESPACE,
+ new IcebergEqualsFilter("id", "123988"),
+ testCatalog,
+ new LocalInputSourceFactory(),
+ null,
+ ResidualFilterMode.FAIL
+ );
+ DruidException exception = Assert.assertThrows(
+ DruidException.class,
+ () -> inputSource.createSplits(null, new MaxSizeSplitHintSpec(null,
null))
+ );
+ Assert.assertTrue(
+ "Expect residual error to be thrown",
+ exception.getMessage().contains("residual")
+ );
+ }
+
+ @Test
+ public void testResidualFilterModeFailWithPartitionedTable() throws
IOException
+ {
+ // Create a partitioned table and filter on the partition column
+ TableIdentifier partitionedTableId =
TableIdentifier.of(Namespace.of(NAMESPACE), "partitionedTable");
Review Comment:
We can, I just did separate tables as it means the other table set in
setup() would not get dropped without a preemptive cleanup.
--
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]