EmmyMiao87 commented on a change in pull request #6067:
URL: https://github.com/apache/incubator-doris/pull/6067#discussion_r656765058



##########
File path: fe/fe-core/src/main/java/org/apache/doris/qe/ShowExecutor.java
##########
@@ -1834,7 +1837,51 @@ private void handleShowQueryProfile() throws 
AnalysisException {
 
         resultSet = new ShowResultSet(showStmt.getMetaData(), rows);
     }
-
+    
+    private void handleShowCreateRoutineLoad() throws AnalysisException {
+        ShowCreateRoutineLoadStmt showCreateRoutineLoadStmt = 
(ShowCreateRoutineLoadStmt) stmt;
+        List<List<String>> rows = Lists.newArrayList();
+        // if job exists
+        RoutineLoadJob routineLoadJob;
+        try {
+            routineLoadJob = 
Catalog.getCurrentCatalog().getRoutineLoadManager()
+                    .getJob(showCreateRoutineLoadStmt.getDb(),

Review comment:
       getJob() function will not displayed the routine load in the stopped 
state.

##########
File path: 
fe/fe-core/src/main/java/org/apache/doris/analysis/ShowCreateRoutineLoadStmt.java
##########
@@ -0,0 +1,73 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.analysis;
+
+import org.apache.doris.catalog.Column;
+import org.apache.doris.catalog.ScalarType;
+import org.apache.doris.common.AnalysisException;
+import org.apache.doris.common.ErrorCode;
+import org.apache.doris.common.ErrorReport;
+import org.apache.doris.qe.ShowResultSetMetaData;
+
+// SHOW CREATE ROUTINE LOAD statement.
+public class ShowCreateRoutineLoadStmt extends ShowStmt {
+    
+    private static final ShowResultSetMetaData META_DATA =
+            ShowResultSetMetaData.builder()
+                    .addColumn(new Column("Routine Load", 
ScalarType.createVarchar(20)))
+                    .addColumn(new Column("Create Routine Load", 
ScalarType.createVarchar(30)))
+                    .build();
+    
+    private final LabelName labelName;
+    
+    public ShowCreateRoutineLoadStmt(LabelName labelName) {
+        this.labelName = labelName;
+    }
+    
+    public String getDb() {
+        return labelName.getDbName();
+    }
+    
+    public String getLabel() {
+        return labelName.getLabelName();
+    }
+    
+    @Override
+    public void analyze(Analyzer analyzer) throws AnalysisException {
+        if (labelName == null) {

Review comment:
       Label_name in the grammar file is not optional, so it will not be empty.

##########
File path: fe/fe-core/src/main/java/org/apache/doris/qe/ShowExecutor.java
##########
@@ -1834,7 +1837,51 @@ private void handleShowQueryProfile() throws 
AnalysisException {
 
         resultSet = new ShowResultSet(showStmt.getMetaData(), rows);
     }
-
+    
+    private void handleShowCreateRoutineLoad() throws AnalysisException {
+        ShowCreateRoutineLoadStmt showCreateRoutineLoadStmt = 
(ShowCreateRoutineLoadStmt) stmt;
+        List<List<String>> rows = Lists.newArrayList();
+        // if job exists
+        RoutineLoadJob routineLoadJob;
+        try {
+            routineLoadJob = 
Catalog.getCurrentCatalog().getRoutineLoadManager()

Review comment:
       getRoutineLoadManager().checkPrivAndGetJob()




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

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