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

Enable use of unqualified table names in source connector #223

Merged
merged 3 commits into from
Mar 24, 2023

Conversation

C0urante
Copy link
Contributor

@C0urante C0urante commented Mar 9, 2023

Implements #219

Depends on #222

A new table.names.qualify property is introduced, with a default of true (which preserves existing behavior). When set to false:

  • The connector no longer fails if it detects multiple tables with the same unqualified name
  • Queries are run against the database using unqualified table names
  • If running in incremental or incremental+timestamp mode, an incremental column must be explicitly specified in the connector config (automatic deduction of incremental columns is not supported)

Existing unit tests are adapted/expanded to cover fine-grained logic for this feature, and a new UnqualifiedTableNamesIntegrationTest integration test suite is added to test a few scenarios including different query modes and preservation of offsets across restarts.

@C0urante C0urante requested review from a team as code owners March 9, 2023 18:12
@C0urante C0urante changed the title Unqualified table names Enable use of unqualified table names Mar 9, 2023
@C0urante C0urante changed the title Enable use of unqualified table names Enable use of unqualified table names in source connector Mar 9, 2023
@C0urante C0urante force-pushed the unqualified-table-names branch from 823e62d to 6dc7f4a Compare March 9, 2023 18:15
@C0urante C0urante force-pushed the unqualified-table-names branch from 6dc7f4a to 3b682b2 Compare March 10, 2023 17:02
@C0urante C0urante force-pushed the unqualified-table-names branch from 3b682b2 to c640f4a Compare March 23, 2023 13:29
jeqo
jeqo previously approved these changes Mar 23, 2023
Copy link
Contributor

@jeqo jeqo left a comment

Choose a reason for hiding this comment

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

LGTM +1, just left some minor comments on the config name. Let me know if it make sense. Thanks @C0urante !

config.getString(JdbcSourceConnectorConfig.INCREMENTING_COLUMN_NAME_CONFIG);
if (!qualifyTableNames && (incrementingColumn == null || incrementingColumn.isEmpty())) {
// Otherwise, we may infer the wrong incrementing key for the table
// TODO: This restraint is not necessary in all cases, but additional logic will be required to
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be tracked as an issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm on the fence. IMO filing an issue implies that there is immediate action that can/should be taken; this is more of a note about a potential improvement we can investigate in the future if necessary.

@C0urante
Copy link
Contributor Author

@jeqo thanks for the review! I've updated the config name. Still not sure about ticket vs. TODO; if you have strong feelings one way or the other, can do whatever makes you happy.

Copy link
Contributor

@jeqo jeqo left a comment

Choose a reason for hiding this comment

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

Make sense, just wanted to make sure we are not missing anything 👍🏽
Thanks @C0urante !

@jeqo jeqo merged commit bcdf2a2 into master Mar 24, 2023
@jeqo jeqo deleted the unqualified-table-names branch March 24, 2023 21:56
This was referenced Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants