You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/06/14 02:50:30 UTC

[GitHub] [dolphinscheduler] caishunfeng commented on a diff in pull request #10434: [Feature][Task Plugin] Enable zeppelin task to schedule a whole zeppelin note

caishunfeng commented on code in PR #10434:
URL: https://github.com/apache/dolphinscheduler/pull/10434#discussion_r896323887


##########
dolphinscheduler-task-plugin/dolphinscheduler-task-zeppelin/src/main/java/org/apache/dolphinscheduler/plugin/task/zeppelin/ZeppelinTask.java:
##########
@@ -85,11 +87,32 @@ public void handle() throws Exception {
             }
 
             // Submit zeppelin task
-            ParagraphResult paragraphResult = this.zClient.executeParagraph(noteId, paragraphId, zeppelinParamsMap);
-            String resultContent = paragraphResult.getResultInText();
-            Status status = paragraphResult.getStatus();
-            final int exitStatusCode = mapStatusToExitCode(status);
+            String resultContent;
+            Status status = Status.FINISHED;
+            if (paragraphId == null) {
+                NoteResult noteResult = this.zClient.executeNote(noteId, zeppelinParamsMap);
+                List<ParagraphResult> paragraphResultList = noteResult.getParagraphResultList();
+                StringBuilder resultContentBuilder = new StringBuilder();
+                for (ParagraphResult paragraphResult : paragraphResultList) {
+                    resultContentBuilder.append(
+                            String.format(
+                                    "paragraph_id: %s, paragraph_result: %s\n",
+                                    paragraphResult.getParagraphId(),
+                                    paragraphResult.getResultInText()));
+                    status = paragraphResult.getStatus();
+                    if (status != Status.FINISHED) {

Review Comment:
   Does it mean failure if status is not FINISHED? If so, I think it's better to add some comments.



##########
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-zeppelin.ts:
##########
@@ -45,16 +45,16 @@ export function useZeppelin(model: { [field: string]: any }): IJsonItem[] {
       name: t('project.node.zeppelin_paragraph_id'),
       props: {
         placeholder: t('project.node.zeppelin_paragraph_id_tips')
-      },
-      validate: {
-        trigger: ['input', 'blur'],
-        required: true,
-        validator(validate: any, value: string) {
-          if (!value) {
-            return new Error(t('project.node.zeppelin_paragraph_id_tips'))
-          }
-        }
       }
+//       validate: {

Review Comment:
   I think it should be removed if unuse, WDYT? @songjianet @Amy0104 



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org