n-young opened a new pull request, #58867:
URL: https://github.com/apache/spark/pull/58867
### What changes were proposed in this pull request?
This PR corrects optimizer properties for three Catalyst expressions:
- `PrintToStderr` is non-foldable and non-deterministic because evaluating
it has an observable
stderr side effect.
- `DynamicPruningExpression` is non-foldable so constant folding cannot
discard its runtime
pruning marker.
- `AesEncrypt` is non-deterministic when CBC or GCM must generate a random
IV. ECB and calls with
an explicit non-empty IV remain deterministic and foldable. The same
property is propagated to
the replacement `StaticInvoke` used during execution.
### Why are the changes needed?
These expressions currently inherit properties from their children. With
literal children,
constant folding can therefore execute side effects during optimization,
remove a marker needed by
later planning, or freeze one randomly generated AES IV into the optimized
plan.
### Does this PR introduce _any_ user-facing change?
Yes. `aes_encrypt` calls that omit the IV, or provide an empty IV, are no
longer constant-folded.
Their random IV is generated during execution instead of being fixed during
optimization.
### How was this patch tested?
Added unit tests in `MiscExpressionsSuite` covering all three expressions,
including random-IV,
explicit-IV, and ECB AES cases.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: OpenAI Codex (GPT-5)
--
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]