[
https://issues.apache.org/jira/browse/FLINK-40152?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Xin Chen updated FLINK-40152:
-----------------------------
Description:
== Problem ==
When PostgreSQL has two tables with the same name but different cases (e.g.,
`mytable` and `MyTable`), specifying only one table in `table-name` causes
Flink CDC to capture BOTH tables.
== Root Cause ==
Debezium's `table.include.list` uses `Pattern.CASE_INSENSITIVE` for regex
matching by default (see `io.debezium.util.Strings#includes()`). This causes
`public.mytable` to also match `public.MyTable`.
The issue is in `TableDiscoveryUtils.listTables()`:
{code:java}
Set<TableId> capturedTables =
allTableIds.stream()
.filter(t -> tableFilters.dataCollectionFilter().isIncluded(t))
.collect(Collectors.toSet()); {code}
was:
== Problem ==
When PostgreSQL has two tables with the same name but different cases (e.g.,
`mytable` and `MyTable`), specifying only one table in `table-name` causes
Flink CDC to capture BOTH tables.
== Root Cause ==
Debezium's `table.include.list` uses `Pattern.CASE_INSENSITIVE` for regex
matching by default (see `io.debezium.util.Strings#includes()`). This causes
`public.mytable` to also match `public.MyTable`.
The issue is in `TableDiscoveryUtils.listTables()`:
```java
Set<TableId> capturedTables =
allTableIds.stream()
.filter(t -> tableFilters.dataCollectionFilter().isIncluded(t))
.collect(Collectors.toSet());
> PostgreSQL CDC connector captures case-variant tables when only one is
> specified
> --------------------------------------------------------------------------------
>
> Key: FLINK-40152
> URL: https://issues.apache.org/jira/browse/FLINK-40152
> Project: Flink
> Issue Type: Bug
> Components: Flink CDC
> Affects Versions: 3.0.0, 2.4.0
> Reporter: Xin Chen
> Priority: Major
>
> == Problem ==
> When PostgreSQL has two tables with the same name but different cases (e.g.,
> `mytable` and `MyTable`), specifying only one table in `table-name` causes
> Flink CDC to capture BOTH tables.
> == Root Cause ==
> Debezium's `table.include.list` uses `Pattern.CASE_INSENSITIVE` for regex
> matching by default (see `io.debezium.util.Strings#includes()`). This causes
> `public.mytable` to also match `public.MyTable`.
> The issue is in `TableDiscoveryUtils.listTables()`:
> {code:java}
> Set<TableId> capturedTables =
> allTableIds.stream()
> .filter(t -> tableFilters.dataCollectionFilter().isIncluded(t))
> .collect(Collectors.toSet()); {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)