zahed1994 opened a new pull request, #58344: URL: https://github.com/apache/spark/pull/58344
### What changes were proposed in this pull request? This PR refactors `CreateUserDefinedFunctionCommand` (and concrete subclasses such as `CreateSQLFunctionCommand`) to extend from `UnaryRunnableCommand` taking `child: LogicalPlan` instead of `LeafRunnableCommand`. Specifically: - `CreateUserDefinedFunctionCommand` now extends `UnaryRunnableCommand with CapturesConfig`, wrapping an `UnresolvedIdentifier` prior to analysis and `ResolvedIdentifier` post-analysis as its single child node. - Removes the duplicate `CreateUserDefinedFunction` Catalyst logical plan node from `v2Commands.scala`. - Updates `CreateSQLFunctionCommand` factory and pattern matching usages to construct and handle `UnaryRunnableCommand`. - Added Scaladoc for `CreateSQLFunctionCommand`. ### Why are the changes needed? Following up on SPARK-48730 (#49126), SQL UDF creation was previously represented across two duplicate logical plan abstractions: a Catalyst plan node (`CreateUserDefinedFunction` in `v2Commands.scala`) and an execution command (`CreateUserDefinedFunctionCommand`). Extending `UnaryRunnableCommand` unifies the logical and execution command abstractions into a single `UnaryNode` in Catalyst, allowing name resolution to delegate cleanly to standard catalog rules (`ResolveSessionCatalog`). ### Does this PR introduce _any_ user-facing change? No. Internal Catalyst refactoring only. ### How was this patch tested? - Updated unit test assertions in `CreateSQLFunctionParserSuite`. - Verified Catalyst plan resolution and `CreateSQLFunctionCommand` execution. ### Was this patch authored or co-authored using generative AI tooling? No. -- 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]
