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-34901][connectors/jdbc]Update clause must EXCLUDED unique index. #108

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Mrart
Copy link

@Mrart Mrart commented Mar 21, 2024

As docs 'https://www.postgresql.org/docs/current/sql-insert.html', when we use ON CONFLICT, Update clause must EXCLUDED unique index.
Or it will throw exceptions.like " modification of distribution columns in OnConflictUpdate is not supported Call getNextException to see other errors in the batch."

Copy link

boring-cyborg bot commented Mar 21, 2024

Thanks for opening this pull request! Please check out our contributing guidelines. (https://flink.apache.org/contributing/how-to-contribute.html)

@Mrart Mrart marked this pull request as draft May 10, 2024 01:57
@Mrart Mrart marked this pull request as ready for review May 10, 2024 01:58
@Mrart
Copy link
Author

Mrart commented May 14, 2024

@1996fanrui Can you help me review?

Copy link
Member

@1996fanrui 1996fanrui left a comment

Choose a reason for hiding this comment

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

Thanks @Mrart for the contribution. I left some comments on the code change.

@Mrart Mrart changed the title [FLINK-34901][connectors/jdbc]Improve the performance of the update Postgres database [FLINK-34901][connectors/jdbc]Update clause must EXCLUDED unique index. @Mrart May 23, 2024
@Mrart Mrart changed the title [FLINK-34901][connectors/jdbc]Update clause must EXCLUDED unique index. @Mrart [FLINK-34901][connectors/jdbc]Update clause must EXCLUDED unique index. May 23, 2024
@Mrart Mrart requested a review from 1996fanrui May 27, 2024 02:42
.map(this::quoteIdentifier)
.collect(Collectors.joining(", "));
String updateClause =
Arrays.stream(fieldNames)
.filter(f -> !uniqueKeyFieldsSet.contains(f))
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious is this a bug or performance improvement?

Also cc @RocMarshal , would you mind reviewing this PR as well (as you are the active contributor of jdbc connector)?

Copy link
Member

Choose a reason for hiding this comment

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

It's better to add a test to check it if it's a bug.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @Mrart for the contribution & @1996fanrui for the ping.

It's better to add a test to check it if it's a bug.

+1.

@1996fanrui
Copy link
Member

Hi @Mrart , the CI is failed, could you rebase the main branch and check the CI?

@Mrart Mrart requested a review from 1996fanrui May 28, 2024 00:37
@eskabetxe
Copy link
Member

@Mrart can you rebase and add a test?

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