github-actions[bot] commented on code in PR #62589:
URL: https://github.com/apache/doris/pull/62589#discussion_r3115782627
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/RuntimeFilterTranslator.java:
##########
@@ -190,4 +199,66 @@ private org.apache.doris.planner.RuntimeFilter
finalize(org.apache.doris.planner
origFilter.extractTargetsPosition();
return origFilter;
}
+
+ /**
+ * Classify whether a runtime-filter target expression can drive partition
+ * pruning on the given scan node, by checking that the target expression
+ * resolves (possibly through a chain of Nereids {@link Monotonic}
functions)
+ * to a single partition column and tracking the cumulative direction.
+ *
+ * <p>This must run while the original Nereids {@code Expression} is still
+ * available; legacy planner only sees an {@code analysis.Expr} after
+ * translation and cannot redo the classification. The result is stored on
+ * the legacy {@code RuntimeFilter} and consumed at thrift-serialization
time
+ * (and by {@code OlapScanNode.toThrift} to gate boundary emission).
+ *
+ * <p>Trust the {@code Monotonic} contract — implementers (DateTrunc, Year,
Review Comment:
This is a correctness issue. Several Nereids functions that implement
Monotonic are only conditionally monotonic and rely on isMonotonic(lower,
upper), for example from_unixtime, date_format, time_format, convert_tz, and
yearweek. Because this classifier ignores that hook, a target like
from_unixtime(part_col, %m) can still be marked monotonic and sent to BE. The
BE then projects partition endpoints through the target expression and may
false-prune partitions that cross a wrap boundary, for example a year-spanning
partition whose month set is {12, 01, 02}. Please either consult the
range-aware hook with the actual partition bounds before serializing
monotonicity, or conservatively treat these shapes as NON_MONOTONIC.
--
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]