ThorneANN commented on code in PR #4403:
URL: https://github.com/apache/flink-cdc/pull/4403#discussion_r4594664134


##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-postgres-cdc/src/main/java/org/apache/flink/cdc/connectors/postgres/source/utils/CustomPostgresSchema.java:
##########
@@ -119,26 +118,37 @@ private List<TableChange> readTableSchema(List<TableId> 
tableIds) throws SQLExce
             throw new FlinkRuntimeException("Failed to read schema", e);
         }
 
-        for (TableId tableId : tableIds) {
-            Table table = Objects.requireNonNull(tables.forTable(tableId));
-            // set the events to populate proper sourceInfo into offsetContext
-            offsetContext.event(tableId, Instant.now());
-
-            // TODO: check whether we always set isFromSnapshot = true
+        // Cache all tables discovered by readSchema to avoid redundant full 
scans on future calls.

Review Comment:
   Thank you for your suggestion. I think it makes sense. I will make this 
revision later



-- 
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]

Reply via email to