Uploaded image for project: 'Zeppelin'
  1. Zeppelin
  2. ZEPPELIN-5893

NPE in ParagraphResult when getting progress from paragraphJson

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.11.0
    • None
    • None

    Description

      What is this PR for?

      A few sentences describing the overall goals of the pull request's commits.
      First time? Check out the contributing guide - https://zeppelin.apache.org/contribution/contributions.html
      use ZeppelinClient Example:

      public class ZeppelinTest {
       {{public static void main(String[] args) throws Exception {
      ClientConfig clientConfig = new ClientConfig("http://ip:8080");
      ZeppelinClient zClient = new ZeppelinClient(clientConfig);

      String zeppelinVersion = zClient.getVersion();
      System.out.println("Zeppelin version: " + zeppelinVersion);
      // execute note 2A94M5J1Z paragraph by paragraph
      try {
      //ParagraphResult paragraphResult = zClient.executeParagraph("2HXQ8YRYN", "20230330-101251_25695257");
      ParagraphResult paragraphResult = zClient.executeParagraph("2HXQ8YRYN","20230330-101251_25695257");
      System.out.println("Execute the 1st spark tutorial paragraph, paragraph result: " + paragraphResult);
      /*paragraphResult = zClient.executeParagraph("2A94M5J1Z", "20150210-015302_1492795503");
      System.out.println("Execute the 2nd spark tutorial paragraph, paragraph result: " + paragraphResult);
      Map<String, String> parameters = new HashMap<>();
      parameters.put("maxAge", "40");
      paragraphResult = zClient.executeParagraph("2A94M5J1Z", "20150212-145404_867439529", parameters);
      System.out.println("Execute the 3rd spark tutorial paragraph, paragraph result: " + paragraphResult);
      parameters = new HashMap<>();
      parameters.put("marital", "married");
      paragraphResult = zClient.executeParagraph("2A94M5J1Z", "20150213-230422_1600658137", parameters);}}
      */ System.out.println("Execute the 4th spark tutorial paragraph, paragraph result: " + paragraphResult);
       {{ System.out.println("");
      } finally {
      // you need to stop interpreter explicitly if you are running paragraph
      // separately.
      //zClient.stopInterpreter("2A94M5J1Z", "spark");
      }

      }}}
      }

      exception:
      kong.unirest.json.JSONException: JSONObject["progress"] not found.
      at kong.unirest.json.JSONObject.getProperty(JSONObject.java:954)
      at kong.unirest.json.JSONObject.lambda$getInt$11(JSONObject.java:485)
      at kong.unirest.json.JSONObject.tryNumber(JSONObject.java:961)
      at kong.unirest.json.JSONObject.getInt(JSONObject.java:485)
      at org.apache.zeppelin.client.ParagraphResult.(ParagraphResult.java:48)
      at org.apache.zeppelin.client.ZeppelinClient.queryParagraphResult(ZeppelinClient.java:782)
      at org.apache.zeppelin.client.ZeppelinClient.submitParagraph(ZeppelinClient.java:676)
      at org.apache.zeppelin.client.ZeppelinClient.executeParagraph(ZeppelinClient.java:602)
      at org.apache.zeppelin.client.ZeppelinClient.executeParagraph(ZeppelinClient.java:618)
      at org.apache.dolphinscheduler.plugin.task.zeppelin.ZeppelinTask.handle(ZeppelinTask.java:131)
      at org.apache.dolphinscheduler.server.worker.runner.DefaultWorkerDelayTaskExecuteRunnable.executeTask(DefaultWorkerDelayTaskExecuteRunnable.java:49)

      paragraphJson.getInt("progress"); May occur ong.unirest.json.JSONException: JSONObject["progress"] not found.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              xiaomin99 zzm
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: