JNSimba commented on code in PR #69673:
URL: https://github.com/apache/doris/pull/69673#discussion_r4736354949
##########
fe/fe-core/src/main/java/org/apache/doris/job/extensions/insert/streaming/PostgresResourceValidator.java:
##########
@@ -117,6 +101,70 @@ public static void validate(Map<String, String>
sourceProperties, String jobId,
}
}
+ public static void ensurePublicationCoversTables(Map<String, String>
sourceProperties, String jobId,
+ List<String> tableNames) throws JobException {
+ String configuredName =
sourceProperties.get(DataSourceConfigKeys.PUBLICATION_NAME);
+ // Jobs created before per-job publication names use the CDC client's
legacy default.
+ String publicationName = StringUtils.isNotBlank(configuredName)
+ ? configuredName :
DataSourceConfigKeys.LEGACY_PUBLICATION_NAME;
+ List<String> qualifiedTables = qualifyTables(sourceProperties,
tableNames);
+ JdbcClient jdbcClient =
StreamingJobUtils.getJdbcClient(DataSourceType.POSTGRES, sourceProperties);
+ try (Connection conn = jdbcClient.getConnection()) {
+ if
(!DataSourceConfigKeys.defaultPublicationName(jobId).equals(publicationName)) {
+ validateUserPublication(conn, publicationName,
qualifiedTables);
+ } else {
+ List<String> missing = findMissingTables(conn,
publicationName, qualifiedTables);
Review Comment:
It could be optimized, but since it’s theoretically possible to pinpoint the
location, it shouldn’t be a blocker.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]