Skip to content
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-24397] Remove TableSchema usages from Flink connectors #17459

Closed
wants to merge 3 commits into from

Conversation

fapaul
Copy link

@fapaul fapaul commented Oct 12, 2021

What is the purpose of the change

The TableSchema has been deprecated for a while now unfortunately many of our connectors still use it. This PR tries to address it and migrates the connectors to the new stack. (Schema/ResolvedSchema)

I'll create a follow-up ticket to do the same for the hive connector because it has some additional complexity. The only other connector which is missing is elasticsearch where we will address the TableSchema usage as part of https://issues.apache.org/jira/browse/FLINK-24323

Brief change log

  • Migrate TableSchema usages and remove outdated table connector code (Hbase, Kafka, Jdbc)

Verifying this change

  • All existing tests still pass

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)

@fapaul fapaul changed the title Flink 24397 wh [FLINK-24397] Remove TableSchema usages from Flink connectors Oct 12, 2021
@flinkbot
Copy link
Collaborator

flinkbot commented Oct 12, 2021

CI report:

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

@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.

Automated Checks

Last check on commit 69e676d (Tue Oct 12 13:12:07 UTC 2021)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!

Mention the bot in a comment to re-run the automated checks.

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.


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

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.

Thanks for the PR @fapaul. I added some comments. In particular, I would suggest to scan the changes again whether ResolvedSchema is used within a TableFactory. This should not be necessary anymore.

* <p>Support cache the result to avoid frequent accessing to remote databases. 1.The cacheMaxSize
* is -1 means not use cache. 2.For real-time data, you need to set the TTL of cache.
*/
public class JdbcLookupFunction extends TableFunction<Row> {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we drop this? is there a similar RowData one?

Copy link
Author

Choose a reason for hiding this comment

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

"VARBINARY(10)",
"The Derby dialect doesn't support type: VARBINARY(10)."),
"BINARY",
"Unsupported conversion from data type 'BINARY(1)' (conversion class: [B) to type information. Only data types that originated from type information fully support a reverse conversion."),
Copy link
Contributor

Choose a reason for hiding this comment

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

this exception seems wrong. we should not use a conversion from data type to legacy type information anymore

Copy link
Author

Choose a reason for hiding this comment

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

Unfortunately, I am not really sure what the correct behavior here is. The problem is that this complete test never used the new JDBC connector and always tested with the old one which is now removed. It appears that with the new connector the exception signatures have changed.

Are you proposing to drop the test class completely?

Copy link
Contributor

Choose a reason for hiding this comment

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

The exception indicates that are using a deprecated utility. We should analyze the stack trace where this exception is coming from.

@fapaul
Copy link
Author

fapaul commented Oct 13, 2021

@twalthr thanks for your review, I addressed all comments, can you have another look?

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.

Thanks for the update @fapaul. This leaves the code base a better place. I will merge this once the build is green.

@twalthr
Copy link
Contributor

twalthr commented Oct 19, 2021

@flinkbot run azure

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.

The build succeeded. Merging...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants