Using Apache Zeppelin to build visualizations on top of Apache Trafodion – Updated

//Using Apache Zeppelin to build visualizations on top of Apache Trafodion – Updated


Apache Trafodion (Incubating) and EsgynDB (commercial version from Esgyn) support data visualization tools such as Apache Zeppelin and Tableau with standard JDBC/ODBC connectivity. In this article, we focus on walking you through the steps in leveraging Apache Zeppelin as a data visualization tool on top of Trafodion.


Apache Zeppelin is a modern web-based tool for the data scientists to collaborate over large-scale data exploration and visualization. Large scale data analysis workflow includes multiple steps such as data acquisition, pre-processing and visualization. Zeppelin allows users to create these multiple steps in different execution blocks/paragraphs. This entire sequence of steps/workflow is called a Notebook. Each paragraph is processed by an Interpreter. Zeppelin comes with several default interpreters. To integrate Trafodion or EsgynDB with Zeppelin, we can use the shell interpreter or the PostgreSQL interpreter or JDBC interpreter.



The Zeppelin UI (Client) connects to a Zeppelin Server which then interacts with one or more Interpreters to execute the commands in the paragraphs.


For the Trafodion/EsgynDB integration, we can use the JDBC Interpreter or the Postgres Interpreter to run SQL commands and the shell interpreter to run shell commands on Trafodion/EsgynDB instance.



Step to Configure Zeppelin for Trafodion/EsgynDB

  1. Copy the Trafodion T4 JDBC driver (jdbcT4.jar) to the lib directory under the Zeppelin install folder.
  1. Change ownership of the jdbcT4.jar to the zeppelin user id. When using HDP/Ambari a separate Zeppelin user id is created. On your system, check the ownership of the other jar files in the zeppelin lib folder and set the same ownership to the jdbcT4.jar.
  1. Restart Zeppelin. If you installed Zeppelin using Ambari, you can restart it using Ambari Web console.
  1. Open a browser and login to http://myhost:9995. Zeppelin by default runs on 9995 port. Check your Ambari configuration for details.
  1. You should see a welcome page and the status should show as connected.
  1. First step is to configure a JDBC interpreter to connect to Trafodion/EsgynDB. Click on the Interpreter menu.
  1. Click on the Create.
  1. Fill in the details as shown and click Save to create the interpreter.
    1. Enter a name for your interpreter
    2. From the interpreter drop-down list, select JDBC.
    3. Fill in the Trafodion JDBC driver details and specify the JDBC URL as it matches your Trafodion instance
      • default.driver            org.trafodion.jdbc.t4.T4Driver
      • default.url                  jdbc:t4jdbc://myhost:23400/:
      • default.user               trafodion
      • default.password     traf123
    4. Click Save.
  1. Now Create a new notebook using the “Notebook -> Create new note” menu.
  1. Select your new notebook.
  1. In the top far right corner of the notebook, click on the Interpreter Binding icon.
  1. Select the new Trafodion interpreter you added and drag it to the top of the interpreter list and click Save.
  1. Now enter a sql command like “get schemas” and click on the Run button. You should see a list of all schemas available on your Trafodion/EsgynDB database.
  1. If the execution fails with connection errors or socket errors.
    • Verify that HBase and Trafodion/EsgynDB is fully up and running.
    • Check if the user name and password is correct.
    •  The interpreters timeout after a while and when this happens, you might get socket connection errors. Restarting the interpreter will fix this.
  1. If you still see exceptions, you can check the zeppelin log folder and check the zeppelin server and jdbc interpreter log messages.


By default, when queries are not being executed (or Zeppelin UI is idle) the interpreter closes the connection to the database.  Please remember to restart the interpreter before you begin to run queries again


Sample DDL/Ingestion/Reporting workflow

You can create a workflow in Zeppelin using a sequence of paragraphs with each paragraph implementing a step in your workflow. In the following example we’ll see how you can create a new table using SQL DDL statement and then load data into and finally run a report on the loaded data, all using different paragraphs in the same notebook.

1)     Creating the target Trafodion table

This step is using the JDBC interpreter to run a CREATE DDL statement.

2)     View the HBase attributes of the table using HBase Shell command

This step is using the shell interpreter to run a hbase shell command.

3)     Load data into the table using ODB and CSV files

This step is using the shell interpreter to run ODB tool on the EsgynDB instance.

4)     Run a report on the loaded data

This step is using the JDBC interpreter to run a SQL query.


About the Author:

Venkat Muthuswamy is a Senior Software Architect at Esgyn Corporation