Repository navigation
Conversation
Contributor
Author
|
cc @pan3793 |
pan3793
reviewed
Dec 27, 2025
| val funcName = qualifiedIdent.funcName | ||
| if (registry.functionExists(qualifiedIdent)) { | ||
| // This function has been already loaded into the function registry. | ||
| registry.lookupFunction(qualifiedIdent, arguments) |
Member
There was a problem hiding this comment.
I previously assumed the second round would go here, seems not?
Contributor
Author
There was a problem hiding this comment.
v2 function does not support table function yet, so scalar and table functions has different code paths:
- scalar function looks up the cache at https://github.com/apache/spark/pull/53627/files#diff-9dd0899e5406230aeff96654432da54f35255f6dc60eecb87264a5c508a8c826R2186
- table function looks up the cache at https://github.com/apache/spark/pull/53627/files#diff-9dd0899e5406230aeff96654432da54f35255f6dc60eecb87264a5c508a8c826R2236
pan3793
reviewed
Dec 27, 2025
| * Create a metadata-only V1Function (for DESCRIBE FUNCTION). | ||
| * If invoke() is called, it will throw an error. | ||
| */ | ||
| def apply(info: ExpressionInfo): V1Function = { |
Member
There was a problem hiding this comment.
after this change, calling V1Function(info) would go from the constructor to here, maybe it should use a different name to avoid abuse (especially by external plugins), or just remove it and require the caller to use metadataOnlyBuilder explicitly
pan3793
approved these changes
Dec 29, 2025
pan3793
left a comment
Member
There was a problem hiding this comment.
Thanks, the new V1Function looks much better!
zhengruifeng
approved these changes
Dec 29, 2025
Contributor
|
merged to master |
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 adds
loadPersistentScalarFunctionmethod toSessionCatalog, to unify the scalar function lookup and resolution between v1 and v2 catalogs. The key difference between v1 and v2 catalogs about function is:lookupPersistentFunctionandresolvePersistentFunction.loadFunction. This API returnsUnboundFunction, for invocation, it needs to enter the second phase and callUnboundFunction.bind.The newly added
loadPersistentScalarFunctionmethod follows the v2 catalog style and handles function invocation (load resources and create function builder) in a second phase.Why are the changes needed?
Code cleanup, also also avoid redundant function lookup from catalog introduced by #53531
Does this PR introduce any user-facing change?
No
How was this patch tested?
existing tests
Was this patch authored or co-authored using generative AI tooling?
cursor 2.2.44