Skip to content

Conversation

@bowenli86
Copy link
Member

@bowenli86 bowenli86 commented May 25, 2019

What is the purpose of the change

This PR adds support for basic catalog entries in SQL-Client yaml config file, adds CatalogFactory and CatalogDescriptor, and hooks them up with SQL Client thru table factory discovery service.

Please refer to the design in doc.

Note that more fields of catalog entries and factories for existing catalogs will be added in the next few PRs.

This PR is a replacement of #7393

Brief change log

  • Created CatalogFactory, CatalogDescriptor, CatalogDescriptorValidator in flink table modules
  • Created CatalogEntry and made SQL CLI handle catalog entries in yaml file
  • Added unit tests

Verifying this change

This change added tests and can be verified as follows:

  • see new unit tests in this PR

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): (yes)
  • 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? (yes)
  • If yes, how is the feature documented? docs will be added later when the feature completes

@flinkbot
Copy link
Collaborator

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.

Details
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@bowenli86
Copy link
Member Author

bowenli86 commented May 26, 2019


private Catalog createCatalog(String name, Map<String, String> catalogProperties, ClassLoader classLoader) {
final CatalogFactory factory =
TableFactoryService.find(CatalogFactory.class, catalogProperties, classLoader);
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we rename the factory service, coz we are here creating catalogs rather than tables.

Copy link
Member Author

@bowenli86 bowenli86 May 28, 2019

Choose a reason for hiding this comment

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

I think it makes sense to rename the factory service and the factory interface itself to something more generic now as it's not only for 'table' anymore. I'll discuss with Timo, and it should be of its own PR.

getCatalog("catalog2", "test")));
}

private static Map<String, Object> getCatalog(String name, String type) {
Copy link
Contributor

Choose a reason for hiding this comment

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

rename to createCatalog or instantiateCatalog?

* also {@link TableFactory} for more information.
*/
@PublicEvolving
public interface CatalogFactory extends TableFactory {
Copy link
Contributor

Choose a reason for hiding this comment

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

It's a little weird that CatalogFactory extends from TableFactory. Any thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

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

see above

Copy link
Contributor

@xuefuz xuefuz left a comment

Choose a reason for hiding this comment

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

Looks mostly good. Some minor review comments.

@bowenli86
Copy link
Member Author

@xuefuz thanks for your review. Can you take another look?

@bowenli86
Copy link
Member Author

The CI failure is due to flink-runtime is broken. Merging

@asfgit asfgit closed this in d3e5bf6 May 28, 2019
@bowenli86 bowenli86 deleted the yaml3 branch May 29, 2019 02:37
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