dataroaring commented on code in PR #56175:
URL: https://github.com/apache/doris/pull/56175#discussion_r2362820660


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateJobInfo.java:
##########
@@ -234,6 +262,32 @@ private AbstractJob analyzeAndCreateJob(String sql, String 
currentDbName,
         }
     }
 
+    private AbstractJob analyzeAndCreateStreamingInsertJob(String sql, String 
currentDbName,
+            JobExecutionConfiguration jobExecutionConfiguration, Map<String, 
String> properties) throws UserException {
+        NereidsParser parser = new NereidsParser();
+        LogicalPlan logicalPlan = parser.parseSingle(sql);
+        if (logicalPlan instanceof InsertIntoTableCommand) {
+            InsertIntoTableCommand insertIntoTableCommand = 
(InsertIntoTableCommand) logicalPlan;
+            try {
+                insertIntoTableCommand.initPlan(ConnectContext.get(), 
ConnectContext.get().getExecutor(), false);
+                return new StreamingInsertJob(labelNameOptional.get(),
+                        JobStatus.PENDING,
+                        currentDbName,
+                        comment,
+                        ConnectContext.get().getCurrentUserIdentity(),
+                        jobExecutionConfiguration,
+                        System.currentTimeMillis(),
+                        sql,
+                        properties);
+            } catch (Exception e) {
+                throw new AnalysisException(e.getMessage());
+            }
+        } else {
+            throw new AnalysisException("Not support this sql : " + sql + " 
Command class is "
+                    + logicalPlan.getClass().getName() + ".");

Review Comment:
   Only xxx is supported to use with streaming job together.



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