Skip to content

Conversation

liuml07
Copy link
Member

@liuml07 liuml07 commented Oct 25, 2022

What is the purpose of the change

Currently the PostgresCatalog#listTables() creates a new connection and prepared statement for every schema and table when listing tables. This can be optimized by reusing those resources.

Brief change log

(for example:)

  • Introduce extractColumnValuesByStatement in base class AbstractJdbcCatalog
  • Reuse connection and prepared in PostgresCatalog#listTables()

Verifying this change

Please make sure both new and modified tests in this PR follows the conventions defined in our code quality guide: https://flink.apache.org/contributing/code-style-and-quality-common.html#testing

(Please pick either of the following options)

This change is already covered by existing tests, such as PostgresCatalogTest.

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

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

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@liuml07
Copy link
Member Author

liuml07 commented Oct 25, 2022

CC @RocMarshal @twalthr

@liuml07 liuml07 changed the title [FLINK-29750][connector-jdbc] Improve PostgresCatalog#listTables() by… [FLINK-29750][connector-jdbc] Improve PostgresCatalog#listTables() by reusing resources Oct 25, 2022
@flinkbot
Copy link
Collaborator

flinkbot commented Oct 25, 2022

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@MartijnVisser
Copy link
Contributor

We've now moved the code from the JDBC connector to its own dedicated repository; please re-route this PR to https://github.com/apache/flink-connector-jdbc

@liuml07
Copy link
Member Author

liuml07 commented Nov 29, 2022

Sounds good. Should we remove the connector code from this Flink repo?

@MartijnVisser
Copy link
Contributor

Sounds good. Should we remove the connector code from this Flink repo?

Not yet, that's planned after a release of the JDBC connector and a discussion on the mailing list. But that hopefully should happen quickly.

@liuml07
Copy link
Member Author

liuml07 commented Nov 30, 2022

Moved to apache/flink-connector-jdbc#4

@liuml07 liuml07 closed this Nov 30, 2022
@liuml07 liuml07 deleted the FLINK-29750 branch November 30, 2022 05:15
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.

3 participants