mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
fixed api method for runNoteJob in notebook rest api
This commit is contained in:
parent
7cc908b3a1
commit
251bb5246d
1 changed files with 19 additions and 1 deletions
|
|
@ -39,6 +39,8 @@ import com.google.common.collect.Sets;
|
|||
import com.google.common.reflect.TypeToken;
|
||||
import com.google.gson.Gson;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.zeppelin.interpreter.InterpreterResult;
|
||||
import org.apache.zeppelin.scheduler.Job;
|
||||
import org.quartz.CronExpression;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
@ -498,7 +500,23 @@ public class NotebookRestApi {
|
|||
return new JsonResponse<>(Status.NOT_FOUND, "note not found.").build();
|
||||
}
|
||||
|
||||
note.runAll();
|
||||
for (Paragraph paragraph : note.getParagraphs()) {
|
||||
note.setLastReplName(paragraph.getId());
|
||||
try {
|
||||
note.run(paragraph.getId());
|
||||
} catch (Exception ex) {
|
||||
LOG.error("Exception from run", ex);
|
||||
if (paragraph != null) {
|
||||
paragraph.setReturn(
|
||||
new InterpreterResult(InterpreterResult.Code.ERROR, ex.getMessage()),
|
||||
ex);
|
||||
paragraph.setStatus(Job.Status.ERROR);
|
||||
}
|
||||
return new JsonResponse<>(Status.PRECONDITION_FAILED,
|
||||
paragraph.getJobName() + " Not selected or Invalid Interpreter bind").build();
|
||||
}
|
||||
}
|
||||
|
||||
return new JsonResponse<>(Status.OK).build();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue