gustavodemorais commented on code in PR #30182:
URL: https://github.com/apache/flink/pull/30182#discussion_r4772524784
##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/DeduplicateTestPrograms.java:
##########
@@ -248,6 +250,184 @@ public class DeduplicateTestPrograms {
+ "keep => 'last')")
.build();
+ public static final TableTestProgram UPDATING_INPUT =
+ TableTestProgram.of(
+ "deduplicate-updating-input",
+ "with one live row per key, every change is
forwarded whatever "
+ + "keep and sequence_by say, a key-only -D
is emitted with the "
+ + "full row, a -D without state emits
nothing, and +U without "
+ + "state is a first record")
+ .setupTableSource(
+ SourceTestStep.newBuilder("customers_cdc")
+ .addSchema(
+ "customer_id STRING PRIMARY KEY
NOT ENFORCED",
+ "city STRING",
+ "lsn BIGINT")
+ .addMode(ChangelogMode.upsert())
+ .producedValues(
+ Row.ofKind(RowKind.INSERT, "c1",
"Berlin", 100L),
+ Row.ofKind(RowKind.UPDATE_AFTER,
"c1", "Munich", 120L),
+ Row.ofKind(RowKind.UPDATE_AFTER,
"c1", "Hamburg", 110L),
+ Row.ofKind(RowKind.DELETE, "c1",
null, null),
+ Row.ofKind(RowKind.DELETE, "c1",
null, null),
+ Row.ofKind(RowKind.UPDATE_AFTER,
"c1", "Bremen", 115L))
+ .build())
+ .setupTableSink(
+ SinkTestStep.newBuilder("sink")
+ .addSchema(
+ "customer_id STRING PRIMARY KEY
NOT ENFORCED",
+ "city STRING",
+ "lsn BIGINT")
+ .consumedValues(
+ "+I[c1, Berlin, 100]",
+ "+U[c1, Munich, 120]",
+ "+U[c1, Hamburg, 110]",
+ "-D[c1, Hamburg, 110]",
+ "+I[c1, Bremen, 115]")
+ .build())
+ .setupTableSink(
+ SinkTestStep.newBuilder("sink_first")
Review Comment:
If `sink_first` had no primary key, this statement would also cover
`DeduplicateKeyedRowFunction` emitting -U for a consumer that needs it, which
no test reaches yet.
--
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]