You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/05/30 07:50:42 UTC

[GitHub] [flink-table-store] tsreaper opened a new pull request, #143: [FLINK-27835] Introduce LeafPredicate interface and children method in Predicate

tsreaper opened a new pull request, #143:
URL: https://github.com/apache/flink-table-store/pull/143

   We'd like to expose a more simple interface in the row data abstraction layer. Instead of the `withPartitionFilter`, `withKeyFIlter` and `withValueFilter` methods in `FileStoreScan`, we'd like to introduce `RowDataScan` containing only one `withFilter` method. We'll enclose the logic to extract partition predicate or key predicate in this method.
   
   To extract partition predicate from a big predicate object we'll need to look into this predicate tree. That's why we'll need `children` method and `LeafPredicate` interface to help us represent this tree structure.


-- 
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-unsubscribe@flink.apache.org

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


[GitHub] [flink-table-store] JingsongLi commented on a diff in pull request #143: [FLINK-27835] Introduce LeafPredicate interface and children method in Predicate

Posted by GitBox <gi...@apache.org>.
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-unsubscribe@flink.apache.org

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


[GitHub] [flink-table-store] JingsongLi merged pull request #143: [FLINK-27835] Introduce LeafPredicate interface and children method in Predicate

Posted by GitBox <gi...@apache.org>.
JingsongLi merged PR #143:
URL: https://github.com/apache/flink-table-store/pull/143


-- 
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-unsubscribe@flink.apache.org

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