Managing Paragraphs in a Notebook

You can perform various actions on a paragraph of a notebook by using the options from the Paragraph action drop-down menu.

For a paragraph, select the button on the top right corner of the paragraph to open the paragraph action drop-down menu as shown below.

../../../../_images/para-dropdown.png

Select the required action from the menu.

Additionally, you can perform the following actions from the paragraph action drop-down menu if your cluster is running Zeppelin 0.8 or a later version:

  • Run all paragraphs above and below from the selected paragraph.

    The Run all above option runs paragraphs sequentially from the first paragraph of the notebook till the selected paragraph. The Run all below option runs paragraphs sequentially from the selected paragraph to the last paragraph of the notebook.

  • Clone the selected paragraph.

  • Copy the paragraph id.

  • Change the font size.

The following figure shows the paragraph action drop-down menu when the cluster runs Zeppelin 0.8.0 version.

../../../../_images/para-dropdown2.png

Displaying Multiple Outputs in a Single Paragraph

With Zeppelin 0.8, you can run multiple SQL queries in single paragraph separated by semicolon(;). Results are displayed when all the queries run successfully. Otherwise, the paragraph displays error message. This sequential interpretation of queries allows you to run any number of related queries in a single paragraph which was previously run in multiple paragraphs. You can run queries that result into multiple outputs like table, text, charts and html in same paragraph.

For example: You can create a table, insert values into that table, show table rows in a single paragraph as shown below:

%sql
CREATE Table default.test_trim (width INT, length INT, height INT);
INSERT INTO default.test_trim VALUES (2, 3, 4);
INSERT INTO default.test_trim VALUES (4, 5, 6);
INSERT INTO default.test_trim VALUES (7, 8, 9);
SELECT * FROM default.test_trim;
show tables;

The following animated GIF shows a sample query with mutiple outputs.

../../../../_images/MULTI_OUTPUT.gif

Searching Values in Paragraphs

With Zeppelin 0.8, you can find and replace values anywhere in the notebook code from the notebook action bar or by using the shortcut Ctrl + Option + F as shown in the following figure.

../../../../_images/find-replace.png