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
[FLINK-31398][sql-gateway] OperationExecutor is no longer set context classloader when executing statement. #22294
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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.
Althogh the comment said we need make
HiveParserUtils#getFunctionInfo
use ResourceManager explicitly.But after do some investigation, I found it's not necessary.
Currently, there's two callers to call method
HiveParserUtils#getFunctionInfo
1:
The
fi
will be null after we remove the classloader wrapper as it can't load the function usingThread.currentThread().getContextClassLoader()
. But it's fine since it will then try to find the function from the function catalog. Such case have been convered in flink-sql-client byset.q
.2:
getFuncExprNodeDescWithUdfData
There're two places call method
getFuncExprNodeDescWithUdfData
.a: convertGenericFunc(ExprNodeGenericFuncDesc func), but it will only be called when it's hive build-in function, so it can be found in
Thread.currentThread().getContextClassLoader()
as use must put flink-connector-hive jar which include hive built-in functions to FLINK_HOME/lib to use Hive Dialect.b:
Also,
HiveParserUtils.getFunctionInfo(funcText)
will only be called to when it's build-in function which can then be loaded.AFAIC, it's not easy to make
HiveParserUtils#getFunctionInfo
use ResourceManager explicitly which will involves much modification. I think it's fine to remove the usage of the context classloader in here.cc @fsk119