[FLINK-11237] [table] Enhance LocalExecutor to wrap TableEnvironment w/ classloader #7389
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 is the purpose of the change
This issue was discovered in the course of implementing FLINK-9172, which introduces catalogs to the SQL Client environment. Catalogs are resolved to tables lazily, necessitating this patch.
The
LocalExecutorcalls into the table environment to execute queries, explain statements, and much more. Any call that involves resolving a descriptor to a factory implementation must be wrapped in the context classloader. Some of the calls already are wrapped (for resolving UDFs). With new functionality coming for resolving external catalogs with a descriptor (FLINK-9172), other call sites must be wrapped.This PR wraps all calls from local executor to table environment, for consistency. Seems wise to give the table environment maximum flexibility.
Brief change log
Note: based on PR #7388; please ignore changes outside of
LocalExecutorandExecutionContextand focus on 9637540.Verifying this change
This change is already covered by existing tests, such as
DeploymentTest, which exercises theLocalExecutor's classloading. Note that a subsequent PR will enhanceDeploymentTestfor more coverage (FLINK-9172).Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation