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


##########
fe/fe-core/src/main/java/org/apache/doris/job/extensions/insert/streaming/StreamingInsertJob.java:
##########
@@ -617,6 +625,64 @@ public void alterJob(AlterJobCommand alterJobCommand) 
throws AnalysisException,
         }
     }
 
+    public void prepareIncludeTables(AlterJobCommand command) throws 
AnalysisException, JobException {
+        List<String> updatedTables = command.getIncludeTables();
+        if (updatedTables == null) {
+            return;
+        }
+        if (new HashSet<>(updatedTables).equals(new HashSet<>(syncTables))) {
+            return;
+        }
+        if 
(command.getProperties().containsKey(StreamingJobProperties.OFFSET_PROPERTY)) {
+            throw new AnalysisException("Cannot alter include_tables and 
offset together");
+        }
+        validateComputeGroupProperty(command.getProperties());
+        List<String> addedTables = new ArrayList<>(updatedTables);
+        addedTables.removeAll(syncTables);
+        Map<String, String> source = new HashMap<>(sourceProperties);
+        source.putAll(command.getSourceProperties());
+        validateAlterSourceProperties(command, source);
+        source = buildConvertedSourceProperties(source);
+        Map<String, String> target = new HashMap<>(targetProperties);
+        target.putAll(command.getTargetProperties());
+        try {
+            // Prepare resources before entering JobManager's global write 
lock.
+            StreamingJobUtils.validateAndCreateTables(targetDb, dataSourceType,

Review Comment:
   This behavior is consistent with `create`.



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