Notebook Advanced Features
Overview
Yeedu notebooks include advanced features for performance optimization, configuration management, and cluster integration.
Session Management
Auto-Stop on Cluster Error
Notebooks automatically stop when the cluster enters an error state:
- Prevents data loss from queries
- Clears resources immediately
- Preserves notebook state for recovery
- Notification displayed to user
Manual Session Control
- Open notebook session menu
- View active cluster
- Options available:
- Detach From Cluster: Keep notebook, stop using cluster
- Restart Session: Clear variables, start fresh
- Stop Session: Save notebook, close session
Turbo Mode
Enable/disable Turbo optimization for faster processing:
Enable Turbo
- From cluster dropdown in notebook editor
- Click Turbo Enable/Disable
- Toggle Turbo Mode on
- Optimizations applied immediately
Turbo Features
- Optimized execution time
- Better resource utilization
- Recommended for large queries
- May use additional memory
Max Concurrency
Control parallel task execution:
Configure Max Concurrency
- In notebook create/edit form
- Find Max Concurrency field
- Set number (e.g., 4, 8, 16)
- Controls parallel task count
- Save configuration
Concurrency Guidance
- Low (1-2): Sequential, minimal resources
- Medium (4-8): Balanced parallelism
- High (16+): Maximum parallelism (more resources)
Impact
- Higher concurrency = faster execution
- Higher concurrency = more resources needed
- Too high may cause resource contention
- Fine-tune based on cluster size
Create Cluster from Notebook
Create a new cluster directly without leaving notebook:
Create Cluster Button
- In notebook toolbar
- Click Cluster Selector dropdown
- Select Create New Cluster
- Quick cluster creation dialog opens
Configuration
- Cluster Name: Identifier for new cluster
- Cluster Size: Small, medium, large
- Cloud Environment: Select where to create
- Click Create to provision
Automatic Attachment
- New cluster created in background
- Notebook attached automatically upon completion
- Continue working once ready
- Monitor creation in cluster status
dbutils.widgets Panel
Render dbutils widgets in the Widgets Panel:
What are dbutils.widgets?
Widgets allow interactive parameters in notebooks:
dbutils.widgets.text("param_name", "default_value", "Label")
Widget Rendering
- After cell execution with widgets
- Widgets Panel appears (right sidebar)
- Shows all defined widgets:
- Text input
- Dropdown select
- Date picker
- Range slider
Using Widgets
- Set widget values in Widgets Panel
- Reference in code:
dbutils.widgets.get("param_name") - Run cells to use updated values
- Great for parameterized notebooks
Example Workflow
# Define widgets
dbutils.widgets.text("customer_id", "1", "Customer ID")
# Use widget value
customer_id = dbutils.widgets.get("customer_id")
# Query using parameter
df = spark.sql(f"""
SELECT * FROM customers
WHERE id = {customer_id}
""")
Download Notebook Run Data Snapshots
Export notebook execution data for analysis:
Create Snapshot
- Execute notebook cells
- Click File menu
- Select Download Run Snapshot
- Choose data to include:
- Cell outputs
- Variable states
- Execution time
- Resource metrics
Snapshot Contents
The snapshot includes:
- Cell code and execution order
- Cell outputs (text, tables, plots)
- Variable values (snapshots at time of export)
- Execution metadata
- Notebook structure
Use Cases
- Share results with team
- Reproducibility documentation
- Historical analysis
- Backup execution state
- Offline review
File Format
Snapshots exported as:
- JSON: Structured data format
- HTML: Interactive viewer
- ZIP: Complete package with artifacts
Advanced Notebook Options
For Scala Notebooks
Scala now supports advanced options:
- Packages: Add Maven dependencies
- Jars: Include JAR files
- Files: Reference configuration files
- Conf: Spark configuration parameters
- Metastore Configuration: Catalog settings
Configuration Example
// In Advanced Options:
// Packages: org.apache.commons:commons-math3:3.6.1
// Conf: spark.executor.memory=4g
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics
For Python and SQL
Similar advanced options available:
- Packages: pip packages
- Conf: Spark parameters
- Environment: Custom environment variables
Notebook Lock Status
Notebook Locking
Notebooks can be locked by:
- Author for protection
- Admin for governance
- Temporary during important work
Lock Indicators
- 🔒 Locked: Cannot edit
- 🔓 Unlocked: Can edit
- ⊘ Read-Only: View only
Action Availability
- Locked notebooks show Request Edit button
- Request sent to notebook owner
- Owner can unlock for editing
- Actions disabled based on permissions
Variable Inspector
Monitor variables and their state:
Open Inspector
- Click Variables panel
- See all current variables:
- Variable name
- Type (int, string, DataFrame, etc.)
- Current value (if simple)
- Memory size (for large objects)
Using Inspector
- Verify variable values
- Check data types
- Debug variable issues
- Monitor DataFrame schemas
- Review cached datasets
Collaborative Editing
Multiple users can work on same notebook:
Sharing a Notebook
- Click Share button
- Add users or groups
- Set permissions:
- View: Read-only
- Edit: Can modify
- Admin: Can share and change settings
Real-Time Collaboration
- Changes visible to all users
- Conflict resolution for simultaneous edits
- Comments for discussing code
- Execution tracked per user
Performance Tips
✓ For Better Performance:
- Clear outputs regularly
- Use appropriate data formats (Parquet > CSV)
- Partition large datasets
- Monitor cell execution time
- Use Turbo mode for heavy queries
- Cache frequently accessed DataFrames
✗ Avoid:
- Very large DataFrames in memory
- Unoptimized Spark queries
- Too many small partitions
- Excessive widget refreshes
See Also
- [Create Notebook](./Create notebook.md)
- [Editor Pane](./Editor Pane.md)
- [Notebook Types](./Notebook types.md)
- Auto-Save