-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-20349] [SQL] ListFunctions returns duplicate functions after using persistent functions #17646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| FunctionIdentifier(f) | ||
| } | ||
| } | ||
| val functions = dbFunctions ++ loadedFunctions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of persistent function exists in both dbFunctions and loadedFunctions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dbFunctions
|
Test build #75832 has finished for PR 17646 at commit
|
| FunctionIdentifier(f, Some(dbName)) } | ||
| val loadedFunctions = | ||
| StringUtils.filterPattern(functionRegistry.listFunction(), pattern).map { f => | ||
| // In functionRegistry, function names are stored as an unquoted format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we use FunctionIdentifier as the key in functionRegistry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Will do it using this way in the following refactoring.
We can first fix the issue and then backport it to the previous branches.
|
LGTM |
…ing persistent functions ### What changes were proposed in this pull request? The session catalog caches some persistent functions in the `FunctionRegistry`, so there can be duplicates. Our Catalog API `listFunctions` does not handle it. It would be better if `SessionCatalog` API can de-duplciate the records, instead of doing it by each API caller. In `FunctionRegistry`, our functions are identified by the unquoted string. Thus, this PR is try to parse it using our parser interface and then de-duplicate the names. ### How was this patch tested? Added test cases. Author: Xiao Li <[email protected]> Closes #17646 from gatorsmile/showFunctions. (cherry picked from commit 01ff035) Signed-off-by: Xiao Li <[email protected]>
|
Thanks! Merging to master/2.1 |
…functions after using persistent functions Revert the changes of #17646 made in Branch 2.1, because it breaks the build. It needs the parser interface, but SessionCatalog in branch 2.1 does not have it. ### What changes were proposed in this pull request? The session catalog caches some persistent functions in the `FunctionRegistry`, so there can be duplicates. Our Catalog API `listFunctions` does not handle it. It would be better if `SessionCatalog` API can de-duplciate the records, instead of doing it by each API caller. In `FunctionRegistry`, our functions are identified by the unquoted string. Thus, this PR is try to parse it using our parser interface and then de-duplicate the names. ### How was this patch tested? Added test cases. Author: Xiao Li <[email protected]> Closes #17661 from gatorsmile/compilationFix17646.
…ing persistent functions ### What changes were proposed in this pull request? The session catalog caches some persistent functions in the `FunctionRegistry`, so there can be duplicates. Our Catalog API `listFunctions` does not handle it. It would be better if `SessionCatalog` API can de-duplciate the records, instead of doing it by each API caller. In `FunctionRegistry`, our functions are identified by the unquoted string. Thus, this PR is try to parse it using our parser interface and then de-duplicate the names. ### How was this patch tested? Added test cases. Author: Xiao Li <[email protected]> Closes apache#17646 from gatorsmile/showFunctions.
What changes were proposed in this pull request?
The session catalog caches some persistent functions in the
FunctionRegistry, so there can be duplicates. Our Catalog APIlistFunctionsdoes not handle it.It would be better if
SessionCatalogAPI can de-duplciate the records, instead of doing it by each API caller. InFunctionRegistry, our functions are identified by the unquoted string. Thus, this PR is try to parse it using our parser interface and then de-duplicate the names.How was this patch tested?
Added test cases.