loserwang1024 commented on code in PR #4004:
URL: https://github.com/apache/flink-cdc/pull/4004#discussion_r2061973935
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-postgres-cdc/src/test/java/org/apache/flink/cdc/connectors/postgres/table/PostgreSQLConnectorITCase.java:
##########
@@ -232,6 +232,118 @@ void testConsumingAllEvents(boolean parallelismSnapshot)
result.getJobClient().get().cancel().get();
}
+ @ParameterizedTest
+ @ValueSource(booleans = {true, false})
+ void testConsumingAllEventsForPartitionedTable(boolean parallelismSnapshot)
+ throws SQLException, ExecutionException, InterruptedException {
+ setup(parallelismSnapshot);
+ initializePostgresTable(POSTGRES_CONTAINER, "inventory_partitioned");
+ String publicationName = "dbz_publication_" + new
Random().nextInt(1000);
+ String slotName = getSlotName();
+ try (Connection connection = getJdbcConnection(POSTGRES_CONTAINER);
+ Statement statement = connection.createStatement()) {
+ statement.execute(
+ String.format(
+ "CREATE PUBLICATION %s FOR TABLE
inventory_partitioned.products "
+ + " WITH
(publish_via_partition_root=true)",
+ publicationName));
+ statement.execute(
+ String.format(
+ "select
pg_create_logical_replication_slot('%s','pgoutput');",
+ slotName));
Review Comment:
We can also create a new sub-partition table and insert data here. Newly
added partition table will also be read.
--
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]