Hands on Zeppelin
# Hands on Zeppelin: Step by Step
In order to build a data playground enabling the engineers to explore data collected by autonomous cars, I am trying to deploy Apache Zeppelin as a component of data platform.
# Introduction
Apache Zeppelin is: “Web-based notebook that enables data-driven, interactive data analytics and collaborative documents with SQL, Scala, Python, R and more.”
# Install
According to installation document, I choose to install Zeppelin using the offical docker on a server (http://10.10.32.4):
|
|
These two error was raised because of Volume mapping issue with Zeppelin, you can fix it to add
-u 0
parameter to set the user to 0 (root) in docker run.
|
|
or you can change the owner of dir logs
and notebook
using:
|
|
Then visit http://10.10.32.4:8080/ to use Zeppelin.
# Create New Note
Create a new note through these two entries by giving it a name and select a default interpreter.

You can use multiple interpreter in one zeppeline note to support different languages. You can get this via ChatGPT. See details in “Q&A (with ChatGPT on Zeppelin)” part.
I write 3 different code snippet in 3 different languages of Markdown, Python and sql. Run them and we will get:
You can see:
- %md and %python work fine.
- %sql gives an error: Interpreter sql not found.
# Interpreters
We can see and manage Zeppelin’s interpreters via the ‘interpreter’ menu below:

All interpreters are here:
# Add a SQL Interpreter (for ADB)
In order to access data in mysql, add a SQL interpreter:
Reference:
If you want to connect other databases such as
Mysql
,Redshift
andHive
, you need to edit the property values. You can also use Credential for JDBC authentication. Ifdefault.user
anddefault.password
properties are deleted(using X button) for database connection in the interpreter setting page, the JDBC interpreter will get the account information from Credential.
First, add a credential info, which stores safely the username and password of the mysql connection:
Second, add a new interpreter adbsql
as
Remember to add dependencies to locate the jar used to run the mysql driver:
# Access Data using SQL
Then I can access the data in mysql using sql like this:
# Add MySQL Interpreter
The dependency should rather be mysql:mysql-connector-java:5.1.44
than 5.1.41
used before, because
java.sql.SQLException: Unknown system variable ‘query_cache_size’
query_cache_size
was removed in MySQL 8. Check the docs.It works with JDBC driver 5.1.44.
If mysql:mysql-connector-java:5.1.41
is used, query_cache_size
error will be raised.

Then you can access the data in mysql db:
# Store Zeppelin Notes to GitLab Repo
How To: Store Zeppelin Notes in GitHub repo
You can set the local dir for Zeppelin notes to be a git repo and use Zeppelin’s version control feature to manage versions of a notes.
Add a new version and commit

Then git log
will show the history of version:
|
|
Use git push
to push local version to remote repo.
# Q&A (with ChatGPT on Zeppelin)
# Can I use python and sql in one zeppelin note?
ChatGPT:
Yes, it is possible to use Python and SQL together in a Zeppelin notebook. In fact, many data analysis tasks can benefit from combining the capabilities of both languages.
To use Python and SQL together in a Zeppelin notebook, you will first need to make sure that you have the appropriate interpreters installed and configured. In Zeppelin, an interpreter is a plug-in that enables the notebook to execute code in a specific programming language. For Python and SQL, you will need to install and configure the Python and SQL interpreters, respectively.
Once the interpreters are installed and configured, you can use the
%python
and%sql
magic commands in your Zeppelin notebook to switch between Python and SQL code blocks. For example, you could use Python to load and clean your data, and then use SQL to analyze and visualize the cleaned data.Here is an example of how you might use Python and SQL together in a Zeppelin notebook:
|
|
I hope this helps! Let me know if you have any other questions.
# SQL: how to add a sql interpreter to apache zeppelin

# Java: hello world in apache zeppelin
Java interpreter for Apache Zeppelin
ChatGPT: