xiaomin0322 opened a new pull request, #4579:
URL: https://github.com/apache/zeppelin/pull/4579

   ### 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.<init>(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.
   
   ### What type of PR is it?
   Bug Fix
   Improvement
   Feature
   Documentation
   Hot Fix
   Refactoring
   *Please leave your type of PR only*
   Bug Fix
   ### Todos
   * [ ] - Task
   update code 
   ### What is the Jira issue?
   * Open an issue on Jira https://issues.apache.org/jira/browse/ZEPPELIN/
   * Put link here, and add [ZEPPELIN-*Jira number*] in PR title, eg. 
[ZEPPELIN-533]
   
   ### How should this be tested?
   * Strongly recommended: add automated unit tests for any new or changed 
behavior
   * Outline any manual steps to test the PR here.
   
   ### Screenshots (if appropriate)
   
   ### Questions:
   * Does the license files need to update?
   * Is there breaking changes for older versions?
   * Does this needs documentation?
   


-- 
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: dev-unsubscr...@zeppelin.apache.org

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

Reply via email to