github-actions[bot] commented on code in PR #67919:
URL: https://github.com/apache/doris/pull/67919#discussion_r4044589990
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ExpressionTrait.java:
##########
@@ -114,4 +114,9 @@ default boolean isVolatile() {
default boolean containsVolatileExpression() {
return containsType(VolatileExpression.class) && anyMatch(expr ->
((ExpressionTrait) expr).isVolatile());
}
+
+ default boolean containsVolatileOrNoneMovableExpression() {
Review Comment:
[P1] Apply this fence in the filter-pushdown family
This helper is currently used only by `InferPredicates`, while
`PUSH_DOWN_FILTERS` still moves predicates independently.
`PushDownFilterThroughSetOperation` treats only `containsVolatileExpression()`
as unpushable and substitutes every other conjunct into every EXCEPT/INTERSECT
child. For example:
```text
Filter(assert_true(x > 0, 'bad'))
IntersectDistinct
L(x={1})
R(x={-1,1})
```
The original INTERSECT produces only `1`, so the assertion succeeds;
pushdown evaluates its clone on discarded `R.x=-1` and raises. This is distinct
from thread 4043661725: the filter starts above the set operation and never
reaches either guarded `inferNewPredicate` helper. Please use the shared
evaluation-domain fence in `PushDownFilterThroughSetOperation`, audit the
analogous join pushdowns, and add an above-operator regression.
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToBitmapWithCheck.java:
##########
@@ -37,7 +38,7 @@
* ScalarFunction 'to_bitmap_with_check'. This class is generated by
GenerateFunction.
*/
public class ToBitmapWithCheck extends ScalarFunction
- implements UnaryExpression, ExplicitlyCastableSignature,
AlwaysNotNullable {
+ implements UnaryExpression, ExplicitlyCastableSignature,
AlwaysNotNullable, NoneMovableFunction {
Review Comment:
[P1] Avoid making this ordinary scalar globally unprunable
`NoneMovableFunction` controls much more than predicate cloning:
`LogicalProject.pruneOutputs` and `PhysicalProject.pruneOutputs` re-add every
omitted expression with this marker, and project merging preserves it as well.
The reduced plan
```text
Project(a)
Project(a, to_bitmap_with_check(b) AS unused)
Scan(a=1, b=-1)
```
used to prune `unused` and return `a=1`; with this interface, the executable
project retains the expression and BE raises `InvalidArgument` on `-1`, even
though the query never consumes the bitmap. This is separate from the existing
clone-path threads: no predicate inference or set operation is involved. Please
keep this function prunable and use a narrower ‘unsafe to clone onto additional
rows’ contract in inference/pushdown, with an unused-alias regression.
--
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]