Jiabao-Sun opened a new pull request, #87:
URL: https://github.com/apache/flink-connector-mongodb/pull/87
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
Thank you for contributing to the Apache Flink MongoDB connector.
Please follow the Flink contribution guide:
https://flink.apache.org/how-to-contribute/contribute-code/
Use a title in the form "[FLINK-XXXX] Description"
and link the corresponding Jira issue below. Documentation typo fixes do not
require a Jira issue.
-->
## Purpose of the change
Flink 2.3.0 (FLIP-558,
[FLINK-38926](https://issues.apache.org/jira/browse/FLINK-38926)) tightened the
planner: a changelog query whose upsert key differs from the sink's primary key
is now rejected unless the sink DDL declares an ON CONFLICT clause.
MongoPartitionedTableSinkITCase.testSinkIntoPartitionedTableWithMutableShardKey
fails on Flink 2.3.0 with:
> org.apache.flink.table.api.ValidationException: The query has an upsert
key that differs from the primary key of the sink table
'default_catalog.default_database.mongo_sink'. Primary key: [a], upsert key:
none. This can lead to non-deterministic results when multiple records with
different upsert keys map to the same primary key. Please specify an ON
CONFLICT clause to define how conflicts should be handled: ON CONFLICT DO
DEDUPLICATE (update to the latest record, state intensive, since we need to
keep the entire history), or ON CONFLICT DO ERROR (fail on conflict), or ON
CONFLICT DO NOTHING (keep first record).
## Verifying this change
CI passes above flink 2.2
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]