This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git
The following commit(s) were added to refs/heads/master by this push:
new 0c22e07e87 [test] Add missing LeafFunction coverage in
PredicateJsonSerdeTest (#7359)
0c22e07e87 is described below
commit 0c22e07e87b964cd46ce7ddfb08261bc62b85f52
Author: Jiajia Li <[email protected]>
AuthorDate: Sun Mar 8 14:16:40 2026 +0800
[test] Add missing LeafFunction coverage in PredicateJsonSerdeTest (#7359)
---
.../paimon/predicate/PredicateJsonSerdeTest.java | 25 ++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git
a/paimon-common/src/test/java/org/apache/paimon/predicate/PredicateJsonSerdeTest.java
b/paimon-common/src/test/java/org/apache/paimon/predicate/PredicateJsonSerdeTest.java
index 1b18a05b2d..fb12ece9c0 100644
---
a/paimon-common/src/test/java/org/apache/paimon/predicate/PredicateJsonSerdeTest.java
+++
b/paimon-common/src/test/java/org/apache/paimon/predicate/PredicateJsonSerdeTest.java
@@ -156,6 +156,31 @@ class PredicateJsonSerdeTest {
.expectJson(
"{\"kind\":\"LEAF\",\"transform\":{\"name\":\"FIELD_REF\",\"fieldRef\":{\"index\":2,\"name\":\"f2\",\"type\":\"STRING\"}},\"function\":\"LIKE\",\"literals\":[\"%a%b%\"]}"),
+ // LeafPredicate - StartsWith (field index)
+ TestSpec.forPredicate(builder.startsWith(2,
BinaryString.fromString("hello")))
+ .expectJson(
+
"{\"kind\":\"LEAF\",\"transform\":{\"name\":\"FIELD_REF\",\"fieldRef\":{\"index\":2,\"name\":\"f2\",\"type\":\"STRING\"}},\"function\":\"STARTS_WITH\",\"literals\":[\"hello\"]}"),
+
+ // LeafPredicate - EndsWith (field index)
+ TestSpec.forPredicate(builder.endsWith(2,
BinaryString.fromString("world")))
+ .expectJson(
+
"{\"kind\":\"LEAF\",\"transform\":{\"name\":\"FIELD_REF\",\"fieldRef\":{\"index\":2,\"name\":\"f2\",\"type\":\"STRING\"}},\"function\":\"ENDS_WITH\",\"literals\":[\"world\"]}"),
+
+ // LeafPredicate - Contains (field index)
+ TestSpec.forPredicate(builder.contains(2,
BinaryString.fromString("foo")))
+ .expectJson(
+
"{\"kind\":\"LEAF\",\"transform\":{\"name\":\"FIELD_REF\",\"fieldRef\":{\"index\":2,\"name\":\"f2\",\"type\":\"STRING\"}},\"function\":\"CONTAINS\",\"literals\":[\"foo\"]}"),
+
+ // LeafPredicate - Between
+ TestSpec.forPredicate(builder.between(0, 3, 7))
+ .expectJson(
+
"{\"kind\":\"LEAF\",\"transform\":{\"name\":\"FIELD_REF\",\"fieldRef\":{\"index\":0,\"name\":\"f0\",\"type\":\"INT\"}},\"function\":\"BETWEEN\",\"literals\":[3,7]}"),
+
+ // LeafPredicate - NotBetween (negate of Between)
+ TestSpec.forPredicate(builder.between(0, 3, 7).negate().get())
+ .expectJson(
+
"{\"kind\":\"LEAF\",\"transform\":{\"name\":\"FIELD_REF\",\"fieldRef\":{\"index\":0,\"name\":\"f0\",\"type\":\"INT\"}},\"function\":\"NOT_BETWEEN\",\"literals\":[3,7]}"),
+
// LeafPredicate - AlwaysTrue
TestSpec.forPredicate(builder.alwaysTrue())
.expectJson(