kbendick commented on a change in pull request #2062:
URL: https://github.com/apache/iceberg/pull/2062#discussion_r762691292
##########
File path: api/src/test/java/org/apache/iceberg/expressions/TestEvaluator.java
##########
@@ -220,6 +222,27 @@ public void testNotEqual() {
}
+ @Test
+ public void testStartsWith() {
+ StructType struct = StructType.of(required(24, "s",
Types.StringType.get()));
+ Evaluator evaluator = new Evaluator(struct, startsWith("s", "abc"));
+ Assert.assertTrue("abc startsWith abc should be true",
evaluator.eval(TestHelpers.Row.of("abc")));
+ Assert.assertFalse("Abc startsWith abc should be false",
evaluator.eval(TestHelpers.Row.of("Abc")));
+ Assert.assertFalse("a startsWith abc should be false",
evaluator.eval(TestHelpers.Row.of("a")));
+ Assert.assertTrue("abcd startsWith abc should be true",
evaluator.eval(TestHelpers.Row.of("abcd")));
+ }
+
+ @Test
+ public void testNotStartsWith() {
+ StructType struct = StructType.of(required(24, "s",
Types.StringType.get()));
+ Evaluator evaluator = new Evaluator(struct, notStartsWith("s", "abc"));
+ Assert.assertFalse("abc notStartsWith abc should be false",
evaluator.eval(TestHelpers.Row.of("abc")));
Review comment:
Good call. Added.
--
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]