stevenzwu commented on code in PR #7109:
URL: https://github.com/apache/iceberg/pull/7109#discussion_r1170607215
##########
flink/v1.17/flink/src/test/java/org/apache/iceberg/flink/source/TestFlinkScan.java:
##########
@@ -428,11 +433,47 @@ public void testFilterExp() throws Exception {
RandomGenericData.generate(TestFixtures.SCHEMA, 2, 0L));
helper.appendToTable(dataFile1, dataFile2);
TestHelpers.assertRecords(
- runWithFilter(Expressions.equal("dt", "2020-03-20"), "where
dt='2020-03-20'"),
+ runWithFilter(Expressions.equal("dt", "2020-03-20"), "where
dt='2020-03-20'", true),
expectedRecords,
TestFixtures.SCHEMA);
}
+ @Test
+ public void testFilterExp() throws Exception {
+ Table table =
+ catalogResource.catalog().createTable(TestFixtures.TABLE_IDENTIFIER,
TestFixtures.SCHEMA);
+
+ List<Record> expectedRecords =
RandomGenericData.generate(TestFixtures.SCHEMA, 3, 0L);
+ expectedRecords.get(0).set(0, "a");
+ expectedRecords.get(1).set(0, "b");
+ expectedRecords.get(2).set(0, "c");
+
+ GenericAppenderHelper helper = new GenericAppenderHelper(table,
fileFormat, TEMPORARY_FOLDER);
+ DataFile dataFile = helper.writeFile(expectedRecords);
+ helper.appendToTable(dataFile);
+ List<Row> actual =
+ runWithFilter(Expressions.greaterThanOrEqual("data", "b"), "where
data>='b'", true);
+ TestHelpers.assertRecords(actual, expectedRecords.subList(1, 3),
TestFixtures.SCHEMA);
+ }
+
+ @Test
+ public void testFilterExpCaseInsensitive() throws Exception {
Review Comment:
nit: for now, maybe extract a private method to avoid test duplications.
with Junit 5, this can be handled better.
--
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]