Hisoka-X commented on code in PR #4239:
URL: https://github.com/apache/flink-cdc/pull/4239#discussion_r2746436171
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-postgres-cdc/src/main/java/io/debezium/connector/postgresql/connection/PostgresConnection.java:
##########
@@ -696,6 +696,15 @@ public Optional<Column> readColumnForDecoder(
private Optional<ColumnEditor> doReadTableColumn(
ResultSet columnMetadata, TableId tableId, Tables.ColumnNameFilter
columnFilter)
throws SQLException {
+ // FLINK-38965: Filter out columns from other tables that might be
returned due to
+ // PostgreSQL LIKE wildcard matching (underscore '_' matches any
single character).
+ // For example, when querying 'ndi_pg_user_sink_1', the LIKE pattern
may also match
+ // 'ndi_pg_userbsink_1' because '_' acts as a wildcard.
+ final String resultTableName = columnMetadata.getString(3);
Review Comment:
addressed
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-postgres-cdc/src/main/java/io/debezium/connector/postgresql/connection/PostgresConnection.java:
##########
@@ -696,6 +696,15 @@ public Optional<Column> readColumnForDecoder(
private Optional<ColumnEditor> doReadTableColumn(
ResultSet columnMetadata, TableId tableId, Tables.ColumnNameFilter
columnFilter)
throws SQLException {
+ // FLINK-38965: Filter out columns from other tables that might be
returned due to
+ // PostgreSQL LIKE wildcard matching (underscore '_' matches any
single character).
+ // For example, when querying 'ndi_pg_user_sink_1', the LIKE pattern
may also match
+ // 'ndi_pg_userbsink_1' because '_' acts as a wildcard.
+ final String resultTableName = columnMetadata.getString(3);
+ if (!tableId.table().equals(resultTableName)) {
Review Comment:
addressed
--
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]