sunchao opened a new pull request, #25636:
URL: https://github.com/apache/datafusion/pull/25636

   ## Which issue does this PR close?
   
   No existing issue. Adds an explicit evaluation policy for consumers that 
require row-level short-circuit semantics.
   
   ## Rationale for this change
   
   Consumers that require left-to-right evaluation can currently receive errors 
from rows whose result is already determined. For example, `x = 0 OR 1 / x > 0` 
can divide by zero when only some rows have `x = 0`; dynamic `x IN (0, 1 / x)` 
can evaluate the second entry after an earlier match. DataFusion's existing 
Boolean heuristic and eager dynamic IN evaluation do not guarantee those masks.
   
   ## What changes are included in this PR?
   
   - Add opt-in strict evaluation to the existing `BinaryExpr` (AND/OR) and 
`InListExpr`, preserving their identity for metadata and pruning.
   - Retain existing Boolean fast paths and literal-only IN lookup. Strict 
dynamic IN does not evaluate non-literal children during construction.
   - Preserve the policy through child rewrites, equality/hashing, protobuf 
round trips, filter pushdown, and Parquet predicate reordering.
   - Filter only the referenced array when a Column is evaluated under a 
selection.
   
   No SQL planner setting is enabled by this change. The default evaluation 
policy remains unchanged.
   
   ## Are these changes tested?
   
   - Formatting and diff checks passed.
   - Focused tests, required Clippy, and extended workspace tests could not 
compile: the configured local registry mirror does not contain the locked 
`async-compression 0.4.48` dependency. No dependency or registry configuration 
changes are included.
   - Criterion cases cover strict/default Boolean masks at 0%, 50%, and 100% 
selection with narrow/wide batches, plus dynamic IN alongside existing 
literal-list controls. OSS benchmark execution is blocked by the same 
dependency-resolution issue.
   
   ## Are there any user-facing changes?
   
   New physical expression APIs allow callers to require strict masks 
independently of which functions appear in the children. Masking can be 
substantially slower for cheap expressions, so it remains opt-in.
   


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