Apache Zeppelin Documentation
repository·master·Indexed 27 days ago
https://github.com/apache/zeppelinA web-based notebook for interactive data analytics and collaborative data-driven documents. It features built-in Apache Spark integration and supports multiple languages and interpreters, including SQL, Scala, Python, Java, Groovy, MongoDB, InfluxDB 2.0, JDBC, Livy, and BigQuery.
What's inside Apache Zeppelin
- Apache Zeppelin is a web-based notebook designed for interactive data analytics. It allows users to create collaborative, data-driven documents using various languages including SQL and Scala. Key features include a web-based notebook editor and built-in support for Apache Spark.
Overview of Zeppelin Visualization Transformations
masterZeppelin provides four types of transformations to handle how data is rendered and transformed for visualizations. Transformations allow you to set columns and transform table rows according to configured columns.
- PassthroughTransformation: Does not convert the original table data.
- ColumnselectorTransformation: Used when you need multiple axes but do not require aggregation.
- PivotTransformation: Provides grouping and aggregation using three axes:
Keys,Groups, andValues. - AdvancedTransformation: A highly configurable transformation supporting multiple sub-charts, configurable axes, parameter widgets, and multiple transformation methods.
Overview of Zeppelin configuration files
masterZeppelin manages several key configuration files that are stored via the configured storage layer:
interpreter.json: Contains all interpreter setting information.notebook-authorization.json: Contains all notebook authorization information.credential.json: Contains credential information.
Overview of the Spark Interpreter
masterThe Spark interpreter is the primary interpreter in Apache Zeppelin. It provides support for multiple versions of Apache Spark and multiple versions of Scala. It is responsible for creating theSparkContextandSparkSession.Understand the Flink Interpreter project structure
masterThe Flink interpreter is organized into modules to handle different Flink and Scala versions. It is divided into two main groups:
Flink Shims: Used to adapt to different Flink versions due to API changes.
flink-shimsacts as the parent module. At runtime, the interpreter loads specific shims usingFlinkShims#loadShimsbased on the detected Flink version.flink-shims(Parent)flink1.20-shims(Shared by Flink 1.19 and 1.20)
Scala Adapters: Used to adapt to different Scala versions. Since Flink 1.15, only Scala 2.12 is supported.
flink-scala-2.12
Use the MongoDB interpreter in Apache Zeppelin
masterThe MongoDB interpreter allows you to execute MongoDB scripts within Apache Zeppelin notebooks. It utilizes themongo shellto execute scripts. To use it, you must configure the MongoDB interpreter in your Zeppelin instance and ensure you are familiar with MongoDB aggregate functions for data manipulation.Understand Helium plugin types
masterHelium is a plugin system used to extend Apache Zeppelin. It supports four primary types of packages:
- Helium Visualization: Used for adding new chart types.
- Helium Spell: Used for adding new interpreters or display systems that run in the browser.
- Helium Application: Used for adding full applications.
- Helium Interpreter: Used for adding new custom interpreters.
Understand EmbeddingSearch indexing and capabilities
masterUnlike the standard
LuceneSearch,EmbeddingSearchuses ONNX-based sentence embeddings (all-MiniLM-L6-v2) to provide semantic understanding. This allows users to find notebooks using natural language queries (e.g., searching for "yesterday's spending" can find SQL queries usingcurrent_date - 1).Indexed Content:
- Paragraph text: Full text of the paragraph.
- Paragraph title: The title of the paragraph.
- Notebook name: Included in the embedding context.
- Paragraph output: Both
TABLEandTEXToutputs are indexed. - SQL table names: Extracted from
FROMandJOINclauses and used for result boosting. - Interpreter prefix: Stripped from the text before indexing.
Technical Details:
- Model:
all-MiniLM-L6-v2(384-dimensional embeddings). - Model Storage: The 86MB ONNX model is automatically downloaded to
zeppelin.search.index.path/models/on first use. - Performance: Brute-force cosine similarity is used, providing < 50ms search time for up to 50,000 paragraphs.
Understand the Apache Zeppelin Security Model
masterApache Zeppelin is a web-based, multi-user notebook server designed for interactive data analytics. Its primary function is to execute user-supplied code (via pluggable interpreters like Spark, Flink, Python, etc.) on a server.
Key Security Concept: The security model is not about preventing code execution (which is the product's core purpose), but about controlling who is allowed to reach that capability and providing isolation between users and processes.
Deployment Shape:
- A long-running JVM server (
zeppelin-server). - One or more interpreter processes.
- Communication via HTTP/Websockets (browser to server) and Thrift IPC (server to interpreter).
- Often deployed behind a reverse proxy like NGINX.
- A long-running JVM server (
Understand Zeppelin's Security Model (HTTP and WebSocket)
masterZeppelin secures its web application and remote interpreter communication using Apache Shiro. Security is applied across two main channels:
HTTP Endpoint Security
Apache Shiro operates as a servlet filter between the browser and exposed services, handling authentication automatically.
WebSocket Security
Because Zeppelin uses WebSockets for communication, a ticket-based mechanism is used to maintain security:
- Ticket Request: On startup, the browser requests a ticket via an HTTP request.
- Authentication: The Apache Shiro servlet filter authenticates the user.
- Ticket Assignment: Once authenticated, a ticket is assigned to the user and returned to the browser.
- Message Validation: Every WebSocket message must include both the
usernameand theticket. The server validates that the provided ticket matches the one assigned to thatusernameduring the initial HTTP request.
Use the Groovy Interpreter
masterApache Zeppelin supports a Groovy interpreter, allowing you to execute Groovy code within notebooks. For detailed configuration, usage patterns, and interpreter-specific settings, refer to the official Groovy interpreter documentation.Use Zeppelin-Context for data exchange and utilities
masterThezeppelin-context(accessible via the predefined variablezin many programming-language interpreters like Spark and Python) is a system-wide container for user-specific data and utility functions. It allows for data exchange between different cells and even different notebooks by storing and retrieving objects.