JingsongLi commented on code in PR #8116:
URL: https://github.com/apache/paimon/pull/8116#discussion_r3523345683
##########
paimon-core/src/main/java/org/apache/paimon/table/source/KeyValueTableRead.java:
##########
@@ -152,6 +178,33 @@ public RecordReader<InternalRow> reader(Split split)
throws IOException {
throw new RuntimeException("Should not happen.");
}
+ private static boolean hasLateAppliedRowFilter(Split split) {
+ if (split instanceof QueryAuthSplit) {
+ TableQueryAuthResult authResult = ((QueryAuthSplit)
split).authResult();
+ return authResult != null && authResult.extractPredicate() != null;
+ }
+ return false;
+ }
+
+ private boolean needsTableLevelLimit(Split split) {
+ if (limit == null || limit <= 0) {
+ return false;
+ }
+ if (hasLateAppliedRowFilter(split)) {
+ return true;
+ }
+ return !isMergeReadLimitActive(split);
+ }
+
+ private boolean isMergeReadLimitActive(Split split) {
Review Comment:
I still don't understand why you need this method. If it can be done on any
layer, then limit it. What's wrong?
--
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]