Create and edit notebooks
Right-click any notebook in the Big Data Tools window to open the context menu for the basic operations with the notebook. You can also use the following shortcuts:
|Move to trash||Delete|
You can create a new notebook on the target server (remote notebook) or in the current IntelliJ IDEA project (local notebook).
Create a remote notebook
In the Big Data Tools window, right-click any of the configured servers or a folder and select from the context menu or press Alt+Insert.
In the Create note dialog, enter the name of the notebook. You can use the
/symbol to create a notebook within a folder. Click OK.
The newly added notebook appears in the Big Data Tools window.
In IntelliJ IDEA, you can create notebooks that are stored locally.
Create a local notebook
In the Project tool window, select the project root, press Alt+Insert, and select Zeppelin Notebook.
In the Create Zeppelin Notebook dialog, enter the notebook name and press Enter.
The newly added local notebook appears in the Project tool window.
Once you create a notebook, it opens in the editor. The newly added notebook has one executable paragraph marked with the
Press Enter and start editing your notebook right away.
IntelliJ IDEA enables code assistance to facilitate editing and validating Scala code:
Code completion helps you complete the names of classes, functions, and variables. Start typing the name of the code construct, and the suggestion list appears.
Renaming (Shift+F6) local variables or private methods can be done easily inline since only the limited scope is affected. Renaming classes or public methods could potentially impact a lot of files. Preview potential changes before you refactor.
The Extract Method (Ctrl+Alt+M) refactoring lets you take a code fragment that can be grouped together, move it into a separated method and replace the old code with a call to the method.
The Find Usages action (Alt+F7) allows you to search for the references of your code element throughout the entire notebook.
With code inspections, IntelliJ IDEA analyzes your code, searches for ways to optimize it, and detects potential and actual problems. You can always press Alt+Enter to show intention actions and select an available fix. For example, you can add a missing import statement:
You can navigate to the initial declaration of a symbol and symbol's type from its usage. Select a variable and press Ctrl+B.
For quick navigation between the notebook paragraphs and code constructs, use the Structure tool window. Press Alt+7 to toggle its visibility.
Any time you need to add more paragraphs or delete the current paragraph, just press Alt+Enter and select the required action:
You are not limited to adding only Scala code paragraphs. For example, to add any markdown code, just add
md right after the delimiter or
sql for an SQL statement.
Note, that you don't need to save your edits. Auto-saving is triggered by various events, for example, closing a notebook or a project, or quitting the IDE.
Manage interpreter bindings
Once you have added code to your notebook, you're ready to execute it and analyze the data. However, you can customize the interpreters used to execute paragraphs by the target server.
On the notebook editor toolbar, click .
In the Interpreter Bindings dialog, use the arrow buttons to alter the priority of an interpreter. You can also deselect an interpreter and explicitly disable it or restart any interpreter when, for example, the corresponding session got expired.