Skip to content

Conversation

@EronWright
Copy link
Contributor

@EronWright EronWright commented Dec 31, 2018

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 LocalExecutor calls 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

  • use the context classloader for all interactions with TableEnvironment

Note: based on PR #7388; please ignore changes outside of LocalExecutor and ExecutionContext and focus on 9637540.

Verifying this change

This change is already covered by existing tests, such as DeploymentTest, which exercises the LocalExecutor's classloading. Note that a subsequent PR will enhance DeploymentTest for more coverage (FLINK-9172).

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? N/A

…y table

- fix the logic in supportsBatch to properly declare a batch-only table
- adjust CommonTestData to provide batch-only or streaming-only tables

Signed-off-by: EronWright <eronwright@gmail.com>
Signed-off-by: EronWright <eronwright@gmail.com>
…w/ user classloader

- use the context classloader for all interactions with TableEnvironment

Signed-off-by: EronWright <eronwright@gmail.com>
@EronWright
Copy link
Contributor Author

@twalthr any reservation about merging this?

@EronWright
Copy link
Contributor Author

@twalthr ping

Copy link
Contributor

@twalthr twalthr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @EronWright. Sorry for the delay. These changes make sense. Merging...

@asfgit asfgit closed this in 4973d8a Mar 13, 2019
HuangZhenQiu pushed a commit to HuangZhenQiu/flink that referenced this pull request Apr 22, 2019
…ent w/ user classloader

Use the context classloader for all interactions with TableEnvironment.

This closes apache#7389.
sunhaibotb pushed a commit to sunhaibotb/flink that referenced this pull request May 8, 2019
…ent w/ user classloader

Use the context classloader for all interactions with TableEnvironment.

This closes apache#7389.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants