JingsongLi commented on code in PR #6697:
URL: https://github.com/apache/paimon/pull/6697#discussion_r2625701137


##########
paimon-common/src/main/java/org/apache/paimon/predicate/RowIdPredicateVisitor.java:
##########
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.predicate;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import static org.apache.paimon.table.SpecialFields.ROW_ID;
+
+/**
+ * The {@link PredicateVisitor} to extract a list of Row IDs from predicates. 
The returned Row IDs
+ * can be pushed down to manifest readers and file readers to enable efficient 
random access.
+ *
+ * <p>Note that there is a significant distinction between returning {@code 
null} and returning an
+ * empty set:
+ *
+ * <ul>
+ *   <li>{@code null} indicates that the predicate cannot be converted into a 
random-access pattern,
+ *       meaning the filter is not consumable by this visitor.
+ *   <li>An empty set indicates that no rows satisfy the predicate (e.g. 
{@code WHERE _ROW_ID = 3
+ *       AND _ROW_ID IN (1, 2)}).
+ * </ul>
+ */
+public class RowIdPredicateVisitor implements PredicateVisitor<Set<Long>> {

Review Comment:
   Can we return `Set<Range>`? In this way, we can support min max pushdown.



-- 
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]

Reply via email to