-
Notifications
You must be signed in to change notification settings - Fork 156
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
base: main
Are you sure you want to change the base?
Conversation
…Postgres database
Thanks for opening this pull request! Please check out our contributing guidelines. (https://flink.apache.org/contributing/how-to-contribute.html) |
@1996fanrui Can you help me review? |
There was a problem hiding this 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.
...src/main/java/org/apache/flink/connector/jdbc/dialect/AbstractPostgresCompatibleDialect.java
Outdated
Show resolved
Hide resolved
.map(this::quoteIdentifier) | ||
.collect(Collectors.joining(", ")); | ||
String updateClause = | ||
Arrays.stream(fieldNames) | ||
.filter(f -> !uniqueKeyFieldsSet.contains(f)) |
There was a problem hiding this comment.
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)?
There was a problem hiding this comment.
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.
There was a problem hiding this 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 & @1996fanrui for the ping.
It's better to add a test to check it if it's a bug.
+1.
Hi @Mrart , the CI is failed, could you rebase the main branch and check the CI? |
@Mrart can you rebase and add a test? |
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."