Running Zeppelin Notebooks

After creating a notebook, you can either run the required paragraphs by using the Run option for a paragraph or run all paragraphs by using the Run All Paragraphs option.

Note

If your cluster is running Zeppelin 0.8 or a later version, then all the paragraphs of the notebook are run sequentially.

From a notebook, you can run any other notebook or a paragraph of a different notebook by using the z.runNote(noteId) or z.run(noteId, paragraphId) functions, respectively.

Note

This option is available in Zeppelin 0.8 and later versions.

When you run a notebook or a paragraph from another notebook, the notebook or paragraph runs in the same context as of the caller notebook. All the variables defined in the specified notebook or paragraph become available in the caller paragraph.

If you run a paragraph that calls another notebook, which in turn calls the caller paragraph, the execution fails with a message Cycle Detected.

Running a Notebook from Another Notebook

  1. Open the notebook that you want to run and copy the notebook ID.

  2. Open the notebook from which you want to run.

  3. In a paragraph, enter z.runNote("noteId").

  4. Run the paragraph.

The following animated GIF shows how to run a notebook from another notebook.

../../../../_images/zrun.gif

Running a Paragraph of a Notebook

  1. Open the notebook that contains the paragraph that you want to run.

  2. Select the paragraph and click on the paragraph menu on the right side of the paragraph.

  3. Click on the paragraph ID to copy the ID to the clipboard.

  4. Open the notebook from which you want to run.

  5. In a paragraph, enter z.run("noteId", "paragraphId"), where the noteId is the notebook ID of the paragraph.

  6. Run the paragraph.

The following animated GIF shows how to run a paragraph of a different notebook from a notebook.

../../../../_images/zrun-cycle.gif