xiangfu0 commented on code in PR #20422:
URL: https://github.com/apache/pinot/pull/20422#discussion_r4795198688


##########
pinot-core/src/main/java/org/apache/pinot/core/query/request/context/QueryContext.java:
##########
@@ -278,6 +280,36 @@ public FilterContext getRowFilter() {
     return _rowFilter;
   }
 
+  /// Returns the policy for this segment, including a single-table query's 
shared policy.
+  @Nullable
+  public FilterContext getRowFilter(IndexSegment segment) {
+    if (_segmentRowFilters.isEmpty()) {
+      return _rowFilter;
+    }
+    SegmentRowFilter rowFilter = _segmentRowFilters.get(segment);
+    return rowFilter != null ? rowFilter.filter() : null;
+  }
+
+  /// Returns a backing table policy and the schema used to resolve virtual 
columns in it.
+  @Nullable
+  public SegmentRowFilter getSegmentRowFilter(IndexSegment segment) {
+    return _segmentRowFilters.get(segment);
+  }
+
+  /// Returns whether any scan in this query has a row-level security filter.
+  public boolean hasRowFilter() {

Review Comment:
   A couple of plan paths still decide on `getFilter() == null` alone: 
`DistinctPlanNode.run()` (line 59, the dictionary-based operator) and 
`SelectionQuerySegmentPruner` (lines 67 and 107, the count-based pruning). The 
per-table policies travel as query options and are not part of `getFilter()`, 
so should those paths also check `hasRowFilter()`, the way 
`resolveAndRestrictionPushdown` now does? A test for each on a logical table 
with a policy would pin it.



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

Reply via email to