uros-b opened a new pull request, #58941: URL: https://github.com/apache/spark/pull/58941
### What changes were proposed in this pull request? `WindowExpression.hasWindowExpression` tests for a nested `WindowExpression` with `e.find(_.isInstanceOf[WindowExpression]).isDefined`. This replaces it with the equivalent `e.exists(_.isInstanceOf[WindowExpression])`. ### Why are the changes needed? On `TreeNode`, `find(pred).isDefined` and `exists(pred)` perform the same short-circuiting traversal, but `find` wraps the first match in an `Option` only for it to be discarded by `isDefined`. `exists` returns the `Boolean` directly, avoiding that allocation and reading more clearly. Behavior is unchanged. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing tests. This is a behavior-preserving refactor; the `catalyst` module compiles cleanly. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 4.8) -- 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]
