kbendick commented on a change in pull request #2062:
URL: https://github.com/apache/iceberg/pull/2062#discussion_r571705897
##########
File path:
spark2/src/test/java/org/apache/iceberg/spark/source/TestFilteredScan.java
##########
@@ -500,6 +534,48 @@ public void testUnpartitionedStartsWith() {
Assert.assertEquals("junction", matchedData.get(0));
}
+ @Test
+ public void testUnpartitionedNotStartsWith() {
+ Dataset<Row> df = spark.read()
+ .format("iceberg")
+ .option(SparkReadOptions.VECTORIZATION_ENABLED,
String.valueOf(vectorized))
+ .load(unpartitioned.toString());
+
+ List<String> matchedData = df.select("data")
+ .where("data NOT LIKE 'jun%'")
+ .as(Encoders.STRING())
+ .collectAsList();
+
+ List<String> expected = testRecords(SCHEMA).stream()
+ .map(r -> r.getField("data").toString())
+ .filter(d -> !d.startsWith("jun"))
+ .collect(Collectors.toList());
+
+ Assert.assertEquals(9, matchedData.size());
+ Assert.assertEquals(new HashSet<>(expected), new HashSet<>(matchedData));
Review comment:
Let me know if you'd like me to remove any further tests from here.
I removed the one that duplicates this (but uses the scala spark sql
functions). I kept the tests that mirror the various partitioned by data and
partitioned by id tests for `startsWith`. If you think the latter two tests are
not needed (`testPartitionedByIdNotStartsWith` and
`testPartitionedByDataNotStartsWithFilter`), please let me know and I'd be
happy to remove them.
----------------------------------------------------------------
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]