TutorialApplies to: Unified engine deployments
Build a SQL notebook with a setup cell, an analysis cell, and a short explanation. Run it for two regions and inspect the recorded results.
Before you start
You need SQL notebooks and engine execution. No catalog is required. This lesson uses a temporary view, which is a named query available only in its current session.
1. Create the document
- Open Notebooks → New notebook.
- Name it
Lesson - regional analysis and choose SQL.
- Add a Markdown cell with this text:
2. Add the setup cell
Add a code cell with this SQL:
The view contains six rows when queried. It is not a stored Iceberg table. Creating a new session does not copy the view from the old one.
3. Add a parameter and analysis cell
Open Notebook actions → Parameters. Define region as a required, non-null String with default North. Save the definition.
Add a second code cell:
This cell needs both the setup cell and the notebook parameter. Copy it into the notebook, rather than running it by itself in a new Workbench session.
4. Run in order
- Save the notebook and check Saved to server.
- Select Open session and wait for it to be ready.
- Select Run all.
- Inspect each cell’s state and the second cell’s output.
Expect Books = 60, Games = 15, and Garden = 10. The setup cell runs first because it appears first in the document. Markdown is not submitted as SQL.
Open the recorded run in History. Check its document revision and parameter values. A successful save is different from a completed run.
Change one thing
Set the current region parameter value to South and run the analysis cell again. Expect Games = 30 and Garden = 25. Compare the new recorded run with the North run.
Now open a fresh session and use Run all. Expect the same South totals after the setup cell recreates the view. This shows why the notebook keeps its setup steps in the document.
Check the result
The notebook contains explanation, setup, and analysis in order. North totals 85. South totals 55. The saved document survives a session change, while its temporary view must be recreated.
Clean up
Close the lesson sessions after execution has finished. This removes their session-local state. Keep the notebook or delete only Lesson - regional analysis. No stored tables were created.
Continue
Automate an analysis to publish a repeatable result. The notebook sessions and parameters guides explain these controls in more detail.Last modified on November 4, 2026