JingsongLi commented on code in PR #143:
URL: https://github.com/apache/flink-table-store/pull/143#discussion_r886278203


##########
flink-table-store-core/src/main/java/org/apache/flink/table/store/file/predicate/And.java:
##########
@@ -20,57 +20,40 @@
 
 import org.apache.flink.table.store.file.stats.FieldStats;
 
-import java.util.Objects;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Optional;
 
-/** A {@link Predicate} to eval and. */
-public class And implements Predicate {
+/** A {@link CompoundPredicate.Function} to eval and. */
+public class And implements CompoundPredicate.Function {
 
     private static final long serialVersionUID = 1L;
 
-    private final Predicate predicate1;
-    private final Predicate predicate2;
+    public static final And INSTANCE = new And();
 
-    public And(Predicate predicate1, Predicate predicate2) {
-        this.predicate1 = predicate1;
-        this.predicate2 = predicate2;
-    }
+    private And() {}
 
     @Override
-    public boolean test(Object[] values) {
-        return predicate1.test(values) && predicate2.test(values);
+    public boolean test(Object[] values, List<Predicate> children) {
+        return children.stream().allMatch(p -> p.test(values));

Review Comment:
   Don't use java8 stream in critical path, it has poor performance.



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to