This topic describes how to access the Zeppelin web UI from E-MapReduce (EMR) and
use different analytics engines in Zeppelin. After you access the Zeppelin web UI,
you can perform big data analytics and visualization on the web UI.
Access the Zeppelin web UI
- Go to the Cluster Overview page.
- Log on to the Alibaba Cloud EMR console.
- In the top navigation bar, select the region where your cluster resides and select a resource group based on your business requirements.
- Click the Cluster Management tab.
- On the Cluster Management page, find your cluster and click Details in the Actions column.
- In the left-side navigation pane, click Connect Strings.
- Click the link of Zeppelin.
The Zeppelin web UI appears.
Examples of using analytics engines in Zeppelin
The following examples apply only to EMR V3.33.0 and later V3.X.X versions, and EMR
V4.6.0 and later V4.X.X versions.
Use Spark in Zeppelin
- On the Zeppelin web UI, click Create new note.
- In the Create new note dialog box, specify Note Name and select spark for Default Interpreter.
- Click create.
- On the Notebook page, run commands to analyze data.
You do not need to configure an interpreter because Spark Interpreter is configured
in EMR Zeppelin by default. Spark runs in yarn-cluster mode by default. The following
three types of code are supported:
- Spark Scala
%spark
indicates that Spark Scala code is used.
%spark
val df = spark.read.options(Map("inferSchema"->"true","delimiter"->";","header"->"true"))
.csv("file:///usr/lib/spark-current/examples/src/main/resources/people.csv")
z.show(df)
df.registerTempTable("people")
Information similar to that shown in the following figure is returned.

- PySpark
%spark.pyspark
indicates that PySpark code is used.
%spark.pyspark
df = spark.read.csv('file:///usr/lib/spark-current/examples/src/main/resources/people.csv',header=True,sep=';')
df.show()
Information similar to that shown in the following figure is returned.

- Spark SQL
%spark.sql
indicates that Spark SQL code is used.
%spark.sql
show tables;
select * from people;
Information similar to that shown in the following figure is returned.

Use Flink in Zeppelin
- On the Zeppelin web UI, click Create new note.
- In the Create new note dialog box, specify Note Name and select flink for Default Interpreter.
- Click create.
- On the Notebook page, run commands to analyze data.
You do not need to configure an interpreter because Flink Interpreter is configured
in EMR Zeppelin by default. The following three types of code are supported:
Use Presto in Zeppelin
- On the Zeppelin web UI, click Create new note.
- In the Create new note dialog box, specify Note Name and select presto for Default Interpreter.
- Click create.
- On the Notebook page, run commands to view table information.
%presto
indicates that Presto SQL code is used. You do not need to configure Presto. Zeppelin
automatically connects to the Presto service of the EMR cluster.
%presto
show tables;
select * from test_1;
Information similar to that shown in the following figure is returned.

Use Impala in Zeppelin
- On the Zeppelin web UI, click Create new note.
- In the Create new note dialog box, specify Note Name and select impala for Default Interpreter.
- Click create.
- On the Notebook page, run commands to view table information.
%impala
indicates that Impala SQL code is used. You do not need to configure Impala. Zeppelin
automatically connects to the Impala service of the EMR cluster.
%impala
drop table if exists test_1;
create table test_1(id int,name string);
insert into test_1 values(1,'test1');
insert into test_1 values(2,'test2');
select * from test_1;
Information similar to that shown in the following figure is returned.

Use Hive in Zeppelin
- On the Zeppelin web UI, click Create new note.
- In the Create new note dialog box, specify Note Name and select hive for Default Interpreter.
- Click create.
- On the Notebook page, run commands to view table information.
%hive
indicates that Hive SQL code is used. You do not need to configure Hive. Zeppelin
automatically connects to the Hive Thrift Server service of the EMR cluster.
%hive
show tables;
select * from test_1;
Information similar to that shown in the following figure is returned.
