[SPARK-20349] [SQL] [REVERT-Branch2.1] ListFunctions returns duplicate functions after using persistent functions #17661
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.
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 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.