JNSimba commented on code in PR #69673:
URL: https://github.com/apache/doris/pull/69673#discussion_r4738300941


##########
fe/fe-core/src/main/java/org/apache/doris/job/util/StreamingJobUtils.java:
##########
@@ -508,6 +507,24 @@ public static LinkedHashMap<String, 
Optional<CreateTableCommand>> generateCreate
         }
     }
 
+    public static void validateAndCreateTables(String targetDb, DataSourceType 
sourceType,
+            Map<String, String> properties, Map<String, String> 
targetProperties,
+            List<String> updatedTables, List<String> addedTables) throws 
Exception {
+        Map<String, Optional<CreateTableCommand>> commands = 
generateCreateTableCmds(
+                targetDb, sourceType, properties, targetProperties);
+        for (String table : updatedTables) {
+            if (!commands.containsKey(table)) {
+                throw new JobException("Source table does not exist: " + 
table);
+            }
+        }
+        for (String table : addedTables) {
+            Optional<CreateTableCommand> command = commands.get(table);
+            if (command.isPresent()) {

Review Comment:
   Removing a table from include_tables ends schema tracking for that table and 
clears its source schema baseline. Re-adding it takes a fresh snapshot and 
follows the same rule as initial creation with an existing target: the target 
is reused, and the user is responsible for ensuring it is compatible with the 
current source schema. In the ADD COLUMN w example, the user would need to add 
w to the Doris target before re-adding the table if they want to replicate that 
column. I’ll make this limitation explicit in the PR description and 
documentation.



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

Reply via email to