[SPARK-50698][SQL] Refactor CreateUserDefinedFunction command to extend from UnaryRunnableCommand - #58344
Open
zahed1994 wants to merge 14 commits into
Open
[SPARK-50698][SQL] Refactor CreateUserDefinedFunction command to extend from UnaryRunnableCommand#58344zahed1994 wants to merge 14 commits into
zahed1994 wants to merge 14 commits into
Conversation
…nd from UnaryRunnableCommand ### What changes were proposed in this pull request? This PR refactors `CreateUserDefinedFunctionCommand` to extend from `UnaryRunnableCommand`, taking `child: LogicalPlan`. It follows up on apache#49126 (SPARK-48730) by removing the duplicate `CreateUserDefinedFunction` Catalyst logical plan from `v2Commands.scala` and unifying the command structure. ### Why are the changes needed? To simplify and unify the logical command abstractions for SQL UDFs introduced in apache#49126. ### Does this PR introduce any user-facing change? No. ### How was this patch tested? - Updated unit tests in `CreateSQLFunctionParserSuite`.
…d from UnaryRunnableCommand
…ction logical plan node
…logical plan node
… in CreateSQLFunctionCommand
zahed1994
force-pushed
the
SPARK-50698-unary-runnable-udf-command
branch
from
August 28, 2026 18:06
31b63b5 to
95e3e4b
Compare
…y functions regardless of catalog
…ions and add MiMa filters
…traction for ResolvedIdentifier
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR refactors
CreateUserDefinedFunctionCommand(and concrete subclasses such asCreateSQLFunctionCommand) to extend fromUnaryRunnableCommandtakingchild: LogicalPlaninstead ofLeafRunnableCommand.Specifically:
CreateUserDefinedFunctionCommandnow extendsUnaryRunnableCommand with CapturesConfig, wrapping anUnresolvedIdentifierprior to analysis andResolvedIdentifierpost-analysis as its single child node.CreateUserDefinedFunctionCatalyst logical plan node fromv2Commands.scala.CreateSQLFunctionCommandfactory and pattern matching usages to construct and handleUnaryRunnableCommand.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 (
CreateUserDefinedFunctioninv2Commands.scala) and an execution command (CreateUserDefinedFunctionCommand).Extending
UnaryRunnableCommandunifies the logical and execution command abstractions into a singleUnaryNodein 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?
CreateSQLFunctionParserSuite.CreateSQLFunctionCommandexecution.Was this patch authored or co-authored using generative AI tooling?
No.