vladanvasi-db opened a new pull request, #59861: URL: https://github.com/apache/spark/pull/59861
### What changes were proposed in this pull request? Addresses [SPARK-60614](https://issues.apache.org/jira/browse/SPARK-60614). - Add a `TableOutputResolver.resolveVariableOutputColumns` overload accepting resolved output attributes and an alias factory. Retain the existing three-argument entry point. - Extract duplicate-target validation into `VariableAssignmentUtils` and reuse it from `ResolveSetVariable` and `ResolveFetchCursor`. - Centralize the existing `DUPLICATE_ASSIGNMENTS` exception in `QueryCompilationErrors.duplicateAssignmentsError`. ### Why are the changes needed? `SET VARIABLE` and `FETCH INTO` currently duplicate target validation and error construction. Sharing these helpers keeps their behavior consistent. The output-resolution overload lets callers reuse assignment casts without recursively accessing `LogicalPlan.output`, while allowing the single-pass resolver to track generated aliases through its existing alias provider. This PR only prepares the shared helpers; it does not add single-pass `SET VARIABLE` support. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? - Catalyst production compilation (`build/sbt -batch -no-colors catalyst/compile`) and its dependencies passed with SBT 1.13.0, JDK 17, and Scala 2.13. The local build used the installed SBT launcher and cached Maven mirror. - `git diff --check` passed. - No new tests were added for the behavior-preserving extraction. Unit and integration tests have not been run; the new explicit-output/custom-alias overload does not yet have dedicated test coverage. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: OpenAI Codex CLI 0.164.0 -- 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]
