HeartSaVioR opened a new pull request, #56057: URL: https://github.com/apache/spark/pull/56057
### What changes were proposed in this pull request? Introduce two new methods on `LogicalPlan`: - `def isStateful: Boolean = false` -- per-operator declaration of whether the node is a streaming stateful operator (kept across microbatches). - `def containsStatefulOperator: Boolean` -- subtree-level check, memoized. Override `isStateful` on the operators that are streaming stateful: `Aggregate`, `Join` (stream-stream), `GlobalLimit`, `Distinct`, `Deduplicate`, `DeduplicateWithinWatermark`, `FlatMapGroupsWithState`, `FlatMapGroupsInPandasWithState`, `TransformWithState`, `TransformWithStateInPySpark`. ### Why are the changes needed? This will be used as a convenient utility for future works. Currently we ask each rule to re-derive the stateful-operator check via pattern matching. ### Does this PR introduce any user-facing change? No. ### How was this patch tested? N/A. ### Was this patch authored or co-authored using generative AI tooling? Yes. Generated-by: Claude 4.6 Opus -- 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]
