openinx commented on a change in pull request #1893:
URL: https://github.com/apache/iceberg/pull/1893#discussion_r547985792
##########
File path:
flink/src/test/java/org/apache/iceberg/flink/TestFlinkTableSource.java
##########
@@ -102,4 +105,154 @@ public void testLimitPushDown() {
Assert.assertEquals("should have 1 record", 1, mixedResult.size());
Assert.assertArrayEquals("Should produce the expected records",
mixedResult.get(0), new Object[] {1, "a"});
}
+
+ @Test
+ public void testFilterPushDown() {
+ sql("INSERT INTO %s VALUES (1,'a'),(2,'b'),(3,CAST(null AS VARCHAR))",
TABLE_NAME);
+
+ String expectedExplain = "FilterPushDown";
+
+ // not push down
+ String sqlNoPushDown = "SELECT * FROM " + TABLE_NAME + " WHERE data LIKE
'%a%' ";
+ String explainNoPushDown = getTableEnv().explainSql(sqlNoPushDown);
+ assertFalse("explain should not contains FilterPushDown",
explainNoPushDown.contains(expectedExplain));
+
+ // equal
+ String sqlLiteralRight = String.format("SELECT * FROM %s WHERE id = 1 ",
TABLE_NAME);
+ String explain = getTableEnv().explainSql(sqlLiteralRight);
+ assertTrue("explain should contains FilterPushDown",
explain.contains(expectedExplain));
Review comment:
I will suggest to have a more strict assertion to validate the pushed
filter's internal information, see
https://github.com/generic-datalake/iceberg-poc/pull/2/files#diff-5d18d1ff127d1dc70a9a15bbe941f2b6f9d28b3015924f601ac1f722914099dbR96
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]