CINXE.COM
Apache Zeppelin 0.10.1 Documentation: Generic JDBC Interpreter for Apache Zeppelin
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Apache Zeppelin 0.10.1 Documentation: Generic JDBC Interpreter for Apache Zeppelin</title> <meta name="description" content="Generic JDBC Interpreter lets you create a JDBC connection to any data source. You can use Postgres, MySql, MariaDB, Redshift, Apache Hive, Presto/Trino, Impala, Apache Phoenix, Apache Drill and Apache Tajo using JDBC interpreter."> <meta name="author" content="The Apache Software Foundation"> <!-- Enable responsive viewport --> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Le HTML5 shim, for IE6-8 support of HTML elements --> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <!-- Le styles --> <link href="/docs/0.10.1/assets/themes/zeppelin/bootstrap/css/bootstrap.css" rel="stylesheet"> <link href="/docs/0.10.1/assets/themes/zeppelin/css/style.css?body=1" rel="stylesheet" type="text/css"> <link href="/docs/0.10.1/assets/themes/zeppelin/css/syntax.css" rel="stylesheet" type="text/css" media="screen" /> <!-- Le fav and touch icons --> <!-- Update these with your own images <link rel="shortcut icon" href="images/favicon.ico"> <link rel="apple-touch-icon" href="images/apple-touch-icon.png"> <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png"> <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png"> --> <!-- Js --> <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script> <script src="/docs/0.10.1/assets/themes/zeppelin/bootstrap/js/bootstrap.min.js"></script> <script src="/docs/0.10.1/assets/themes/zeppelin/js/docs.js"></script> <script src="/docs/0.10.1/assets/themes/zeppelin/js/anchor.min.js"></script> <script src="/docs/0.10.1/assets/themes/zeppelin/js/toc.js"></script> <script src="/docs/0.10.1/assets/themes/zeppelin/js/lunr.min.js"></script> <script src="/docs/0.10.1/assets/themes/zeppelin/js/search.js"></script> <!-- atom & rss feed --> <link href="/docs/0.10.1/atom.xml" type="application/atom+xml" rel="alternate" title="Sitewide ATOM Feed"> <link href="/docs/0.10.1/rss.xml" type="application/rss+xml" rel="alternate" title="Sitewide RSS Feed"> </head> <body> <div id="menu" class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container navbar-container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <div class="navbar-brand"> <a class="navbar-brand-main" href="http://zeppelin.apache.org"> <img src="/docs/0.10.1/assets/themes/zeppelin/img/zeppelin_logo.png" width="50" style="margin-top: -2px;" alt="I'm zeppelin"> <span style="margin-left: 5px; font-size: 27px;">Zeppelin</span> <a class="navbar-brand-version" href="/docs/0.10.1" style="font-size: 15px; color: white;"> 0.10.1 </a> </a> </div> </div> <nav class="navbar-collapse collapse" role="navigation"> <ul class="nav navbar-nav"> <li> <a href="#" data-toggle="dropdown" class="dropdown-toggle">Quick Start <b class="caret"></b></a> <ul class="dropdown-menu"> <li class="title"><span>Getting Started</span></li> <li><a href="/docs/0.10.1/quickstart/install.html">Install</a></li> <li><a href="/docs/0.10.1/quickstart/explore_ui.html">Explore UI</a></li> <li><a href="/docs/0.10.1/quickstart/tutorial.html">Tutorial</a></li> <li role="separator" class="divider"></li> <li class="title"><span>Run Mode</span></li> <li><a href="/docs/0.10.1/quickstart/kubernetes.html">Kubernetes</a></li> <li><a href="/docs/0.10.1/quickstart/docker.html">Docker</a></li> <li><a href="/docs/0.10.1/quickstart/yarn.html">Yarn</a></li> <li role="separator" class="divider"></li> <li><a href="/docs/0.10.1/quickstart/spark_with_zeppelin.html">Spark with Zeppelin</a></li> <li><a href="/docs/0.10.1/quickstart/flink_with_zeppelin.html">Flink with Zeppelin</a></li> <li><a href="/docs/0.10.1/quickstart/sql_with_zeppelin.html">SQL with Zeppelin</a></li> <li><a href="/docs/0.10.1/quickstart/python_with_zeppelin.html">Python with Zeppelin</a></li> <li><a href="/docs/0.10.1/quickstart/r_with_zeppelin.html">R with Zeppelin</a></li> </ul> </li> <li> <a href="#" data-toggle="dropdown" class="dropdown-toggle">Usage<b class="caret"></b></a> <ul class="dropdown-menu scrollable-menu"> <li class="title"><span>Dynamic Form</span></li> <li><a href="/docs/0.10.1/usage/dynamic_form/intro.html">What is Dynamic Form?</a></li> <li role="separator" class="divider"></li> <li class="title"><span>Display System</span></li> <li><a href="/docs/0.10.1/usage/display_system/basic.html#text">Text Display</a></li> <li><a href="/docs/0.10.1/usage/display_system/basic.html#html">HTML Display</a></li> <li><a href="/docs/0.10.1/usage/display_system/basic.html#table">Table Display</a></li> <li><a href="/docs/0.10.1/usage/display_system/basic.html#network">Network Display</a></li> <li><a href="/docs/0.10.1/usage/display_system/angular_backend.html">Angular Display using Backend API</a></li> <li><a href="/docs/0.10.1/usage/display_system/angular_frontend.html">Angular Display using Frontend API</a></li> <li role="separator" class="divider"></li> <li class="title"><span>Interpreter</span></li> <li><a href="/docs/0.10.1/usage/interpreter/overview.html">Overview</a></li> <li><a href="/docs/0.10.1/usage/interpreter/interpreter_binding_mode.html">Interpreter Binding Mode</a></li> <li><a href="/docs/0.10.1/usage/interpreter/user_impersonation.html">User Impersonation</a></li> <li><a href="/docs/0.10.1/usage/interpreter/dependency_management.html">Dependency Management</a></li> <li><a href="/docs/0.10.1/usage/interpreter/installation.html">Installing Interpreters</a></li> <!--<li><a href="/docs/0.10.1/usage/interpreter/dynamic_loading.html">Dynamic Interpreter Loading (Experimental)</a></li>--> <li><a href="/docs/0.10.1/usage/interpreter/execution_hooks.html">Execution Hooks (Experimental)</a></li> <li role="separator" class="divider"></li> <li class="title"><span>Other Features</span></li> <li><a href="/docs/0.10.1/usage/other_features/publishing_paragraphs.html">Publishing Paragraphs</a></li> <li><a href="/docs/0.10.1/usage/other_features/personalized_mode.html">Personalized Mode</a></li> <li><a href="/docs/0.10.1/usage/other_features/customizing_homepage.html">Customizing Zeppelin Homepage</a></li> <li><a href="/docs/0.10.1/usage/other_features/notebook_actions.html">Notebook Actions</a></li> <li><a href="/docs/0.10.1/usage/other_features/cron_scheduler.html">Cron Scheduler</a></li> <li><a href="/docs/0.10.1/usage/other_features/zeppelin_context.html">Zeppelin Context</a></li> <li role="separator" class="divider"></li> <li class="title"><span>REST API</span></li> <li><a href="/docs/0.10.1/usage/rest_api/interpreter.html">Interpreter API</a></li> <li><a href="/docs/0.10.1/usage/rest_api/zeppelin_server.html">Zeppelin Server API</a></li> <li><a href="/docs/0.10.1/usage/rest_api/notebook.html">Notebook API</a></li> <li><a href="/docs/0.10.1/usage/rest_api/notebook_repository.html">Notebook Repository API</a></li> <li><a href="/docs/0.10.1/usage/rest_api/configuration.html">Configuration API</a></li> <li><a href="/docs/0.10.1/usage/rest_api/credential.html">Credential API</a></li> <li><a href="/docs/0.10.1/usage/rest_api/helium.html">Helium API</a></li> <li class="title"><span>Zeppelin SDK</span></li> <li><a href="/docs/0.10.1/usage/zeppelin_sdk/client_api.html">Client API</a></li> <li><a href="/docs/0.10.1/usage/zeppelin_sdk/session_api.html">Session API</a></li> </ul> </li> <li> <a href="#" data-toggle="dropdown" class="dropdown-toggle">Setup<b class="caret"></b></a> <ul class="dropdown-menu scrollable-menu"> <li class="title"><span>Basics</span></li> <li><a href="/docs/0.10.1/setup/basics/how_to_build.html">How to Build Zeppelin</a></li> <li><a href="/docs/0.10.1/setup/basics/hadoop_integration.html">Hadoop Integration</a></li> <li><a href="/docs/0.10.1/setup/basics/multi_user_support.html">Multi-user Support</a></li> <li role="separator" class="divider"></li> <li class="title"><span>Deployment</span></li> <!--<li><a href="/docs/0.10.1/setup/deployment/docker.html">Docker Image for Zeppelin</a></li>--> <li><a href="/docs/0.10.1/setup/deployment/spark_cluster_mode.html#spark-standalone-mode">Spark Cluster Mode: Standalone</a></li> <li><a href="/docs/0.10.1/setup/deployment/spark_cluster_mode.html#spark-on-yarn-mode">Spark Cluster Mode: YARN</a></li> <li><a href="/docs/0.10.1/setup/deployment/spark_cluster_mode.html#spark-on-mesos-mode">Spark Cluster Mode: Mesos</a></li> <li><a href="/docs/0.10.1/setup/deployment/flink_and_spark_cluster.html">Zeppelin with Flink, Spark Cluster</a></li> <li><a href="/docs/0.10.1/setup/deployment/cdh.html">Zeppelin on CDH</a></li> <li><a href="/docs/0.10.1/setup/deployment/virtual_machine.html">Zeppelin on VM: Vagrant</a></li> <li role="separator" class="divider"></li> <li class="title"><span>Security</span></li> <li><a href="/docs/0.10.1/setup/security/authentication_nginx.html">HTTP Basic Auth using NGINX</a></li> <li><a href="/docs/0.10.1/setup/security/shiro_authentication.html">Shiro Authentication</a></li> <li><a href="/docs/0.10.1/setup/security/notebook_authorization.html">Notebook Authorization</a></li> <li><a href="/docs/0.10.1/setup/security/datasource_authorization.html">Data Source Authorization</a></li> <li><a href="/docs/0.10.1/setup/security/http_security_headers.html">HTTP Security Headers</a></li> <li role="separator" class="divider"></li> <li class="title"><span>Notebook Storage</span></li> <li><a href="/docs/0.10.1/setup/storage/storage.html#notebook-storage-in-local-git-repository">Git Storage</a></li> <li><a href="/docs/0.10.1/setup/storage/storage.html#notebook-storage-in-s3">S3 Storage</a></li> <li><a href="/docs/0.10.1/setup/storage/storage.html#notebook-storage-in-azure">Azure Storage</a></li> <li><a href="/docs/0.10.1/setup/storage/storage.html#notebook-storage-in-oss">OSS Storage</a></li> <li><a href="/docs/0.10.1/setup/storage/storage.html#notebook-storage-in-zeppelinhub">ZeppelinHub Storage</a></li> <li><a href="/docs/0.10.1/setup/storage/storage.html#notebook-storage-in-mongodb">MongoDB Storage</a></li> <li role="separator" class="divider"></li> <li class="title"><span>Operation</span></li> <li><a href="/docs/0.10.1/setup/operation/configuration.html">Configuration</a></li> <li><a href="/docs/0.10.1/setup/operation/proxy_setting.html">Proxy Setting</a></li> <li><a href="/docs/0.10.1/setup/operation/upgrading.html">Upgrading</a></li> <li><a href="/docs/0.10.1/setup/operation/trouble_shooting.html">Trouble Shooting</a></li> </ul> </li> <li> <a href="#" data-toggle="dropdown" class="dropdown-toggle">Interpreter <b class="caret"></b></a> <ul class="dropdown-menu scrollable-menu"> <li class="title"><span>Interpreters</span></li> <li><a href="/docs/0.10.1/usage/interpreter/overview.html">Overview</a></li> <li role="separator" class="divider"></li> <li><a href="/docs/0.10.1/interpreter/spark.html">Spark</a></li> <li><a href="/docs/0.10.1/interpreter/flink.html">Flink</a></li> <li><a href="/docs/0.10.1/interpreter/jdbc.html">JDBC</a></li> <li><a href="/docs/0.10.1/interpreter/python.html">Python</a></li> <li><a href="/docs/0.10.1/interpreter/r.html">R</a></li> <li role="separator" class="divider"></li> <li><a href="/docs/0.10.1/interpreter/alluxio.html">Alluxio</a></li> <li><a href="/docs/0.10.1/interpreter/beam.html">Beam</a></li> <li><a href="/docs/0.10.1/interpreter/bigquery.html">BigQuery</a></li> <li><a href="/docs/0.10.1/interpreter/cassandra.html">Cassandra</a></li> <li><a href="/docs/0.10.1/interpreter/elasticsearch.html">Elasticsearch</a></li> <li><a href="/docs/0.10.1/interpreter/geode.html">Geode</a></li> <li><a href="/docs/0.10.1/interpreter/groovy.html">Groovy</a></li> <li><a href="/docs/0.10.1/interpreter/hazelcastjet.html">Hazelcast Jet</a></li> <li><a href="/docs/0.10.1/interpreter/hbase.html">HBase</a></li> <li><a href="/docs/0.10.1/interpreter/hdfs.html">HDFS</a></li> <li><a href="/docs/0.10.1/interpreter/hive.html">Hive</a></li> <li><a href="/docs/0.10.1/interpreter/ignite.html">Ignite</a></li> <li><a href="/docs/0.10.1/interpreter/influxdb.html">influxDB</a></li> <li><a href="/docs/0.10.1/interpreter/java.html">Java</a></li> <li><a href="/docs/0.10.1/interpreter/jupyter.html">Jupyter</a></li> <li><a href="/docs/0.10.1/interpreter/kotlin.html">Kotlin</a></li> <li><a href="/docs/0.10.1/interpreter/ksql.html">KSQL</a></li> <li><a href="/docs/0.10.1/interpreter/kylin.html">Kylin</a></li> <li><a href="/docs/0.10.1/interpreter/lens.html">Lens</a></li> <li><a href="/docs/0.10.1/interpreter/livy.html">Livy</a></li> <li><a href="/docs/0.10.1/interpreter/mahout.html">Mahout</a></li> <li><a href="/docs/0.10.1/interpreter/markdown.html">Markdown</a></li> <li><a href="/docs/0.10.1/interpreter/mongodb.html">MongoDB</a></li> <li><a href="/docs/0.10.1/interpreter/neo4j.html">Neo4j</a></li> <li><a href="/docs/0.10.1/interpreter/pig.html">Pig</a></li> <li><a href="/docs/0.10.1/interpreter/postgresql.html">Postgresql, HAWQ</a></li> <li><a href="/docs/0.10.1/interpreter/sap.html">SAP</a></li> <li><a href="/docs/0.10.1/interpreter/scalding.html">Scalding</a></li> <li><a href="/docs/0.10.1/interpreter/scio.html">Scio</a></li> <li><a href="/docs/0.10.1/interpreter/shell.html">Shell</a></li> <li><a href="/docs/0.10.1/interpreter/sparql.html">Sparql</a></li> <li><a href="/docs/0.10.1/interpreter/submarine.html">Submarine</a></li> </ul> </li> <li> <a href="#" data-toggle="dropdown" class="dropdown-toggle">More<b class="caret"></b></a> <ul class="dropdown-menu scrollable-menu" style="right: 0; left: auto;"> <li class="title"><span>Extending Zeppelin</span></li> <li><a href="/docs/0.10.1/development/writing_zeppelin_interpreter.html">Writing Zeppelin Interpreter</a></li> <li role="separator" class="divider"></li> <li class="title"><span>Helium (Experimental)</span></li> <li><a href="/docs/0.10.1/development/helium/overview.html">Overview</a></li> <li><a href="/docs/0.10.1/development/helium/writing_application.html">Writing Helium Application</a></li> <li><a href="/docs/0.10.1/development/helium/writing_spell.html">Writing Helium Spell</a></li> <li><a href="/docs/0.10.1/development/helium/writing_visualization_basic.html">Writing Helium Visualization: Basics</a></li> <li><a href="/docs/0.10.1/development/helium/writing_visualization_transformation.html">Writing Helium Visualization: Transformation</a></li> <li role="separator" class="divider"></li> <li class="title"><span>Contributing to Zeppelin</span></li> <li><a href="/docs/0.10.1/setup/basics/how_to_build.html">How to Build Zeppelin</a></li> <li><a href="/docs/0.10.1/development/contribution/useful_developer_tools.html">Useful Developer Tools</a></li> <li><a href="/docs/0.10.1/development/contribution/how_to_contribute_code.html">How to Contribute (code)</a></li> <li><a href="/docs/0.10.1/development/contribution/how_to_contribute_website.html">How to Contribute (website)</a></li> <li role="separator" class="divider"></li> <li class="title"><span>External Resources</span></li> <li><a target="_blank" rel="noopener noreferrer" href="https://zeppelin.apache.org/community.html">Mailing List</a></li> <li><a target="_blank" rel="noopener noreferrer" href="https://cwiki.apache.org/confluence/display/ZEPPELIN/Zeppelin+Home">Apache Zeppelin Wiki</a></li> <li><a target="_blank" rel="noopener noreferrer" href="http://stackoverflow.com/questions/tagged/apache-zeppelin">Stackoverflow Questions about Zeppelin</a></li> </ul> </li> <li> <a href="/docs/0.10.1/search.html" class="nav-search-link"> <span class="fa fa-search nav-search-icon"></span> </a> </li> </ul> </nav><!--/.navbar-collapse --> </div> </div> <div class="content"> <!--<div class="hero-unit Generic JDBC Interpreter for Apache Zeppelin"> <h1></h1> </div> --> <div class="row"> <div class="col-md-12"> <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <h1>Generic JDBC Interpreter for Apache Zeppelin</h1> <div id="toc"></div> <h2>Overview</h2> <p>JDBC interpreter lets you create a JDBC connection to any data sources seamlessly.</p> <p>Inserts, Updates, and Upserts are applied immediately after running each statement.</p> <p>By now, it has been tested with:</p> <div class="row" style="margin: 30px auto;"> <div class="col-md-6"> <img src="/docs/0.10.1/assets/themes/zeppelin/img/docs-img/tested_databases.png" width="300px"/> </div> <div class="col-md-6"> <li style="padding-bottom: 5px; list-style: circle"> <a href="http://www.postgresql.org/" target="_blank" rel="noopener noreferrer">Postgresql</a> - <a href="https://jdbc.postgresql.org/" target="_blank" rel="noopener noreferrer">JDBC Driver</a> </li> <li style="padding-bottom: 5px; list-style: circle"> <a href="https://www.mysql.com/" target="_blank" rel="noopener noreferrer">Mysql</a> - <a href="https://dev.mysql.com/downloads/connector/j/" target="_blank" rel="noopener noreferrer">JDBC Driver</a> </li> <li style="padding-bottom: 5px; list-style: circle"> <a href="https://mariadb.org/" target="_blank" rel="noopener noreferrer">MariaDB</a> - <a href="https://mariadb.com/kb/en/mariadb/about-mariadb-connector-j/" target="_blank" rel="noopener noreferrer">JDBC Driver</a> </li> <li style="padding-bottom: 5px; list-style: circle"> <a href="https://aws.amazon.com/documentation/redshift/" target="_blank" rel="noopener noreferrer">Redshift</a> - <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/configure-jdbc-connection.html" target="_blank" rel="noopener noreferrer">JDBC Driver</a> </li> <li style="padding-bottom: 5px; list-style: circle"> <a href="https://hive.apache.org/" target="_blank" rel="noopener noreferrer">Apache Hive</a> - <a href="https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-JDBC" target="_blank" rel="noopener noreferrer">JDBC Driver</a> </li> <li style="padding-bottom: 5px; list-style: circle"> <a href="https://trino.io/" target="_blank" rel="noopener noreferrer">Presto/Trino</a> - <a href="https://trino.io/docs/current/installation/jdbc.html" target="_blank" rel="noopener noreferrer">JDBC Driver</a> </li> <li style="padding-bottom: 5px; list-style: circle"> <a href="https://impala.apache.org/" target="_blank" rel="noopener noreferrer">Impala</a> - <a href="https://impala.apache.org/docs/build/html/topics/impala_jdbc.html" target="_blank" rel="noopener noreferrer">JDBC Driver</a> </li> <li style="padding-bottom: 5px; list-style: circle"> <a href="https://phoenix.apache.org/" target="_blank" rel="noopener noreferrer">Apache Phoenix</a> itself is a JDBC driver </li> <li style="padding-bottom: 5px; list-style: circle"> <a href="https://drill.apache.org/" target="_blank" rel="noopener noreferrer">Apache Drill</a> - <a href="https://drill.apache.org/docs/using-the-jdbc-driver" target="_blank" rel="noopener noreferrer">JDBC Driver</a> </li> <li style="padding-bottom: 5px; list-style: circle"> <a href="http://tajo.apache.org/" target="_blank" rel="noopener noreferrer">Apache Tajo</a> - <a href="https://tajo.apache.org/docs/current/jdbc_driver.html" target="_blank" rel="noopener noreferrer">JDBC Driver</a> </li> </div> </div> <p>If you are using other databases not in the above list, please feel free to share your use case. It would be helpful to improve the functionality of JDBC interpreter.</p> <h2>Create a new JDBC Interpreter</h2> <p>First, click <code>+ Create</code> button at the top-right corner in the interpreter setting page.</p> <p><img src="/docs/0.10.1/assets/themes/zeppelin/img/docs-img/click_create_button.png" width="600px"/></p> <p>Fill <code>Interpreter name</code> field with whatever you want to use as the alias(e.g. mysql, mysql2, hive, redshift, and etc..). Please note that this alias will be used as <code>%interpreter_name</code> to call the interpreter in the paragraph. Then select <code>jdbc</code> as an <code>Interpreter group</code>. </p> <p><img src="/docs/0.10.1/assets/themes/zeppelin/img/docs-img/select_name_and_group.png" width="200px"/></p> <p>The default driver of JDBC interpreter is set as <code>PostgreSQL</code>. It means Zeppelin includes <code>PostgreSQL</code> driver jar in itself. So you don't need to add any dependencies(e.g. the artifact name or path for <code>PostgreSQL</code> driver jar) for <code>PostgreSQL</code> connection. The JDBC interpreter properties are defined by default like below.</p> <table class="table-configuration"> <tr> <th>Name</th> <th>Default Value</th> <th>Description</th> </tr> <tr> <td>common.max_count</td> <td>1000</td> <td>The maximun number of SQL result to display</td> </tr> <tr> <td>default.driver</td> <td>org.postgresql.Driver</td> <td>JDBC Driver Name</td> </tr> <tr> <td>default.password</td> <td></td> <td>The JDBC user password</td> </tr> <tr> <td>default.url</td> <td>jdbc:postgresql://localhost:5432/</td> <td>The URL for JDBC</td> </tr> <tr> <td>default.user</td> <td>gpadmin</td> <td>The JDBC user name</td> </tr> <tr> <td>default.precode</td> <td></td> <td>Some SQL which executes every time after initialization of the interpreter (see <a href="../usage/interpreter/overview.html#interpreter-binding-mode">Binding mode</a>)</td> </tr> <tr> <td>default.statementPrecode</td> <td></td> <td>SQL code which executed before the SQL from paragraph, in the same database session (database connection)</td> </tr> <tr> <td>default.completer.schemaFilters</td> <td></td> <td>小omma separated schema (schema = catalog = database) filters to get metadata for completions. Supports '%' symbol is equivalent to any set of characters. (ex. prod_v_%,public%,info)</td> </tr> <tr> <td>default.completer.ttlInSeconds</td> <td>120</td> <td>Time to live sql completer in seconds (-1 to update everytime, 0 to disable update)</td> </tr> </table> <p>If you want to connect other databases such as <code>Mysql</code>, <code>Redshift</code> and <code>Hive</code>, you need to edit the property values. You can also use <a href="../setup/security/datasource_authorization.html">Credential</a> for JDBC authentication. If <code>default.user</code> and <code>default.password</code> properties are deleted(using X button) for database connection in the interpreter setting page, the JDBC interpreter will get the account information from <a href="../setup/security/datasource_authorization.html">Credential</a>.</p> <p>The below example is for <code>Mysql</code> connection.</p> <p><img src="/docs/0.10.1/assets/themes/zeppelin/img/docs-img/edit_properties.png" width="600px" /></p> <p>The last step is <strong>Dependency Setting</strong>. Since Zeppelin only includes <code>PostgreSQL</code> driver jar by default, you need to add each driver's maven coordinates or JDBC driver's jar file path for the other databases.</p> <p><img src="/docs/0.10.1/assets/themes/zeppelin/img/docs-img/edit_dependencies.png" width="600px" /></p> <p>That's it. You can find more JDBC connection setting examples(<a href="#mysql">Mysql</a>, <a href="#mariadb">MariaDB</a>, <a href="#redshift">Redshift</a>, <a href="#apache-hive">Apache Hive</a>, <a href="#prestotrino">Presto/Trino</a>, <a href="#impala">Impala</a>, <a href="#apache-phoenix">Apache Phoenix</a>, and <a href="#apache-tajo">Apache Tajo</a>) in <a href="#examples">this section</a>.</p> <h2>JDBC Interpreter Datasource Pool Configuration</h2> <p>The Jdbc interpreter uses the connection pool technology, and supports users to do some personal configuration of the connection pool. For example, we can configure <code>default.validationQuery='select 1'</code> and <code>default.testOnBorrow=true</code> in the Interpreter configuration to avoid the "Invalid SessionHandle" runtime error caused by Session timeout when connecting to HiveServer2 through JDBC interpreter.</p> <p>The Jdbc Interpreter supports the following database connection pool configurations:</p> <table class="table-configuration"> <tr> <th>Property Name</th> <th>Default</th> <th>Description</th> </tr> <tr> <td>testOnBorrow</td> <td>false</td> <td>The indication of whether objects will be validated before being borrowed from the pool. If the object fails to validate, it will be dropped from the pool, and we will attempt to borrow another.</td> </tr> <tr> <td>testOnCreate</td> <td>false</td> <td>The indication of whether objects will be validated after creation. If the object fails to validate, the borrow attempt that triggered the object creation will fail.</td> </tr> <tr> <td>testOnReturn</td> <td>false</td> <td>The indication of whether objects will be validated before being returned to the pool.</td> </tr> <tr> <td>testWhileIdle</td> <td>false</td> <td>The indication of whether objects will be validated by the idle object evictor (if any). If an object fails to validate, it will be dropped from the pool.</td> </tr> <tr> <td>timeBetweenEvictionRunsMillis</td> <td>-1L</td> <td>The number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive, no idle object evictor thread will be run.</td> </tr> <tr> <td>maxWaitMillis</td> <td>-1L</td> <td>The maximum number of milliseconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception, or -1 to wait indefinitely.</td> </tr> <tr> <td>maxIdle</td> <td>8</td> <td>The maximum number of connections that can remain idle in the pool, without extra ones being released, or negative for no limit.</td> </tr> <tr> <td>minIdle</td> <td>0</td> <td>The minimum number of connections that can remain idle in the pool, without extra ones being created, or zero to create none.</td> </tr> <tr> <td>maxTotal</td> <td>-1</td> <td>The maximum number of active connections that can be allocated from this pool at the same time, or negative for no limit.</td> </tr> <tr> <td>validationQuery</td> <td>show database</td> <td>The SQL query that will be used to validate connections from this pool before returning them to the caller. If specified, this query MUST be an SQL SELECT statement that returns at least one row. If not specified, connections will be validation by calling the isValid() method.</td> </tr> </table> <h2>More properties</h2> <p>There are more JDBC interpreter properties you can specify like below.</p> <table class="table-configuration"> <tr> <th>Property Name</th> <th>Description</th> </tr> <tr> <td>common.max_result</td> <td>Max number of SQL result to display to prevent the browser overload. This is common properties for all connections</td> </tr> <tr> <td>zeppelin.jdbc.auth.type</td> <td>Types of authentications' methods supported are <code>SIMPLE</code>, and <code>KERBEROS</code></td> </tr> <tr> <td>zeppelin.jdbc.principal</td> <td>The principal name to load from the keytab</td> </tr> <tr> <td>zeppelin.jdbc.keytab.location</td> <td>The path to the keytab file</td> </tr> <tr> <td>zeppelin.jdbc.auth.kerberos.proxy.enable</td> <td>When auth type is Kerberos, enable/disable Kerberos proxy with the login user to get the connection. Default value is true.</td> </tr> <tr> <td>default.jceks.file</td> <td>jceks store path (e.g: jceks://file/tmp/zeppelin.jceks)</td> </tr> <tr> <td>default.jceks.credentialKey</td> <td>jceks credential key</td> </tr> <tr> <td>zeppelin.jdbc.interpolation</td> <td>Enables ZeppelinContext variable interpolation into paragraph text. Default value is false.</td> </tr> <tr> <td>zeppelin.jdbc.maxConnLifetime</td> <td>Maximum of connection lifetime in milliseconds. A value of zero or less means the connection has an infinite lifetime.</td> </tr> </table> <p>You can also add more properties by using this <a href="http://docs.oracle.com/javase/7/docs/api/java/sql/DriverManager.html#getConnection%28java.lang.String,%20java.util.Properties%29">method</a>. For example, if a connection needs a schema parameter, it would have to add the property as follows:</p> <table class="table-configuration"> <tr> <th>name</th> <th>value</th> </tr> <tr> <td>default.schema</td> <td>schema_name</td> </tr> </table> <h2>How to use</h2> <h3>Run the paragraph with JDBC interpreter</h3> <p>To test whether your databases and Zeppelin are successfully connected or not, type <code>%jdbc_interpreter_name</code>(e.g. <code>%mysql</code>) at the top of the paragraph and run <code>show databases</code>.</p> <div class="highlight"><pre><code class="sql language-sql" data-lang="sql"><span class="o">%</span><span class="n">jdbc_interpreter_name</span> <span class="k">show</span> <span class="n">databases</span> </code></pre></div> <p>If the paragraph is <code>FINISHED</code> without any errors, a new paragraph will be automatically added after the previous one with <code>%jdbc_interpreter_name</code>. So you don't need to type this prefix in every paragraphs' header.</p> <p><img src="/docs/0.10.1/assets/themes/zeppelin/img/docs-img/run_paragraph_with_jdbc.png" width="600px" /></p> <h3>Multiple SQL statements</h3> <p>You can write multiple sql statements in one paragraph, just separate them with semi-colon. e.g</p> <div class="highlight"><pre><code class="sql language-sql" data-lang="sql"><span class="o">%</span><span class="n">jdbc_interpreter_name</span> <span class="n">USE</span> <span class="n">zeppelin_demo</span><span class="p">;</span> <span class="k">CREATE</span> <span class="k">TABLE</span> <span class="n">pet</span> <span class="p">(</span><span class="n">name</span> <span class="nb">VARCHAR</span><span class="p">(</span><span class="mi">20</span><span class="p">),</span> <span class="k">owner</span> <span class="nb">VARCHAR</span><span class="p">(</span><span class="mi">20</span><span class="p">),</span> <span class="n">species</span> <span class="nb">VARCHAR</span><span class="p">(</span><span class="mi">20</span><span class="p">),</span> <span class="n">sex</span> <span class="nb">CHAR</span><span class="p">(</span><span class="mi">1</span><span class="p">),</span> <span class="n">birth</span> <span class="nb">DATE</span><span class="p">,</span> <span class="n">death</span> <span class="nb">DATE</span><span class="p">);</span> </code></pre></div> <h3>SQL Comment</h3> <p>2 kinds of SQL comments are supported:</p> <ul> <li>Single line comment start with <code>--</code></li> <li>Multiple line comment around with <code>/* ... */</code></li> </ul> <div class="highlight"><pre><code class="sql language-sql" data-lang="sql"><span class="o">%</span><span class="n">jdbc_interpreter_name</span> <span class="c1">-- single line comment</span> <span class="k">show</span> <span class="n">tables</span><span class="p">;</span> <span class="cm">/* multiple </span> <span class="cm"> line </span> <span class="cm"> comment</span> <span class="cm"> */</span> <span class="k">select</span> <span class="o">*</span> <span class="k">from</span> <span class="n">test_1</span><span class="p">;</span> </code></pre></div> <h3>Apply Zeppelin Dynamic Forms</h3> <p>You can leverage <a href="../usage/dynamic_form/intro.html">Zeppelin Dynamic Form</a> inside your queries. You can use both the <code>text input</code> and <code>select form</code> parametrization features.</p> <h3>Run SQL Continuously</h3> <p>By default, sql statements in one paragraph are executed only once. But you can run it continuously by specifying local property <code>refreshInterval</code> (unit: milli-seconds), So that the sql statements are executed every interval of <code>refreshInterval</code> milli-seconds. This is useful when your data in database is updated continuously by external system, and you can build dynamic dashboard in Zeppelin via this approach.</p> <p>e.g. Here we query the mysql which is updated continuously by other external system.</p> <p><img src="/docs/0.10.1/assets/themes/zeppelin/img/docs-img/jdbc_refresh.gif" width="800px" /></p> <h3>Usage <em>precode</em></h3> <p>You can set <em>precode</em> for each data source. Code runs once while opening the connection.</p> <h5>Properties</h5> <p>An example settings of interpreter for the two data sources, each of which has its <em>precode</em> parameter.</p> <table class="table-configuration"> <tr> <th>Property Name</th> <th>Value</th> </tr> <tr> <td>default.driver</td> <td>org.postgresql.Driver</td> </tr> <tr> <td>default.password</td> <td>1</td> </tr> <tr> <td>default.url</td> <td>jdbc:postgresql://localhost:5432/</td> </tr> <tr> <td>default.user</td> <td>postgres</td> </tr> <tr> <td>default.precode</td> <td>set search_path='test_path'</td> </tr> </table> <table class="table-configuration"> <tr> <td>default.driver</td> <td>com.mysql.jdbc.Driver</td> </tr> <tr> <td>default.password</td> <td>1</td> </tr> <tr> <td>default.url</td> <td>jdbc:mysql://localhost:3306/</td> </tr> <tr> <td>default.user</td> <td>root</td> </tr> <tr> <td>default.precode</td> <td>set @v=12</td> </tr> </table> <h5>Usage</h5> <p>Test of execution <em>precode</em> for each data source.</p> <div class="highlight"><pre><code class="sql language-sql" data-lang="sql"><span class="o">%</span><span class="n">jdbc</span> <span class="k">show</span> <span class="n">search_path</span> </code></pre></div> <p>Returns value of <code>search_path</code> which is set in the default jdbc (use postgresql) interpreter's <em>default.precode</em>.</p> <div class="highlight"><pre><code class="sql language-sql" data-lang="sql"><span class="o">%</span><span class="n">mysql</span> <span class="k">select</span> <span class="o">@</span><span class="n">v</span> </code></pre></div> <p>Returns value of <code>v</code> which is set in the mysql interpreter's <em>default.precode</em>.</p> <h2>Examples</h2> <p>Here are some examples you can refer to. Including the below connectors, you can connect every databases as long as it can be configured with it's JDBC driver.</p> <h3>Postgres</h3> <p><img src="/docs/0.10.1/assets/themes/zeppelin/img/docs-img/postgres_setting.png" width="600px" /></p> <h5>Properties</h5> <table class="table-configuration"> <tr> <th>Name</th> <th>Value</th> </tr> <tr> <td>default.driver</td> <td>org.postgresql.Driver</td> </tr> <tr> <td>default.url</td> <td>jdbc:postgresql://localhost:5432/</td> </tr> <tr> <td>default.user</td> <td>mysql_user</td> </tr> <tr> <td>default.password</td> <td>mysql_password</td> </tr> </table> <p><a href="https://jdbc.postgresql.org/documentation/documentation.html">Postgres JDBC Driver Docs</a></p> <h5>Dependencies</h5> <table class="table-configuration"> <tr> <th>Artifact</th> <th>Excludes</th> </tr> <tr> <td>org.postgresql:postgresql:9.4.1211</td> <td></td> </tr> </table> <p><a href="https://mvnrepository.com/artifact/org.postgresql/postgresql">Maven Repository: org.postgresql:postgresql</a></p> <h3>Mysql</h3> <p><img src="/docs/0.10.1/assets/themes/zeppelin/img/docs-img/mysql_setting.png" width="600px" /></p> <h5>Properties</h5> <table class="table-configuration"> <tr> <th>Name</th> <th>Value</th> </tr> <tr> <td>default.driver</td> <td>com.mysql.jdbc.Driver</td> </tr> <tr> <td>default.url</td> <td>jdbc:mysql://localhost:3306/</td> </tr> <tr> <td>default.user</td> <td>mysql_user</td> </tr> <tr> <td>default.password</td> <td>mysql_password</td> </tr> </table> <p><a href="https://dev.mysql.com/downloads/connector/j/">Mysql JDBC Driver Docs</a></p> <h5>Dependencies</h5> <table class="table-configuration"> <tr> <th>Artifact</th> <th>Excludes</th> </tr> <tr> <td>mysql:mysql-connector-java:5.1.38</td> <td></td> </tr> </table> <p><a href="https://mvnrepository.com/artifact/mysql/mysql-connector-java">Maven Repository: mysql:mysql-connector-java</a></p> <h3>MariaDB</h3> <p><img src="/docs/0.10.1/assets/themes/zeppelin/img/docs-img/mariadb_setting.png" width="600px" /></p> <h5>Properties</h5> <table class="table-configuration"> <tr> <th>Name</th> <th>Value</th> </tr> <tr> <td>default.driver</td> <td>org.mariadb.jdbc.Driver</td> </tr> <tr> <td>default.url</td> <td>jdbc:mariadb://localhost:3306</td> </tr> <tr> <td>default.user</td> <td>mariadb_user</td> </tr> <tr> <td>default.password</td> <td>mariadb_password</td> </tr> </table> <p><a href="https://mariadb.com/kb/en/mariadb/about-mariadb-connector-j/">MariaDB JDBC Driver Docs</a></p> <h5>Dependencies</h5> <table class="table-configuration"> <tr> <th>Artifact</th> <th>Excludes</th> </tr> <tr> <td>org.mariadb.jdbc:mariadb-java-client:1.5.4</td> <td></td> </tr> </table> <p><a href="https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client">Maven Repository: org.mariadb.jdbc:mariadb-java-client</a></p> <h3>Redshift</h3> <p><img src="/docs/0.10.1/assets/themes/zeppelin/img/docs-img/redshift_setting.png" width="600px" /></p> <h5>Properties</h5> <table class="table-configuration"> <tr> <th>Name</th> <th>Value</th> </tr> <tr> <td>default.driver</td> <td>com.amazon.redshift.jdbc42.Driver</td> </tr> <tr> <td>default.url</td> <td>jdbc:redshift://your-redshift-instance-address.redshift.amazonaws.com:5439/your-database</td> </tr> <tr> <td>default.user</td> <td>redshift_user</td> </tr> <tr> <td>default.password</td> <td>redshift_password</td> </tr> </table> <p><a href="http://docs.aws.amazon.com/redshift/latest/mgmt/configure-jdbc-connection.html">AWS Redshift JDBC Driver Docs</a></p> <h5>Dependencies</h5> <table class="table-configuration"> <tr> <th>Artifact</th> <th>Excludes</th> </tr> <tr> <td>com.amazonaws:aws-java-sdk-redshift:1.11.51</td> <td></td> </tr> </table> <p><a href="https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-redshift">Maven Repository: com.amazonaws:aws-java-sdk-redshift</a></p> <h3>Apache Hive</h3> <p>Zeppelin just connect to <code>hiveserver2</code> to run hive sql via hive jdbc. There are 2 cases of connecting with Hive:</p> <ul> <li>Connect to Hive without KERBEROS</li> <li>Connect to Hive with KERBEROS</li> </ul> <p>Each case requires different settings.</p> <h5>Connect to Hive without KERBEROS</h5> <p>In this scenario, you need to make the following settings at least. By default, hive job run as user of <code>default.user</code>. Refer <a href="../interpreter/jdbc.html#impersonation">impersonation</a> if you want hive job run as the Zeppelin login user when authentication is enabled.</p> <table class="table-configuration"> <tr> <th>Name</th> <th>Value</th> </tr> <tr> <td>default.driver</td> <td>org.apache.hive.jdbc.HiveDriver</td> </tr> <tr> <td>default.url</td> <td>jdbc:hive2://localhost:10000</td> </tr> <tr> <td>default.user</td> <td>hive_user</td> </tr> </table> <table class="table-configuration"> <tr> <th>Artifact</th> <th>Excludes</th> </tr> <tr> <td>org.apache.hive:hive-jdbc:2.3.4</td> <td></td> </tr> </table> <h5>Connect to Hive with KERBEROS</h5> <p>In this scenario, you need to make the following settings at least. By default, hive job run as user of client principal (<code>zeppelin.jdbc.principal</code>). Refer <a href="../interpreter/jdbc.html#impersonation">impersonation</a> if you want hive job run as the Zeppelin login user when authentication is enabled.</p> <table class="table-configuration"> <tr> <th>Name</th> <th>Value</th> </tr> <tr> <td>default.driver</td> <td>org.apache.hive.jdbc.HiveDriver</td> </tr> <tr> <td>default.url</td> <td>jdbc:hive2://emr-header-1:10000/default;principal={hive_server2_principal}</td> </tr> <tr> <td>zeppelin.jdbc.auth.type</td> <td>KERBEROS</td> </tr> <tr> <td>zeppelin.jdbc.keytab.location</td> <td>keytab of client</td> </tr> <tr> <td>zeppelin.jdbc.principal</td> <td>principal of client</td> </tr> </table> <table class="table-configuration"> <tr> <th>Artifact</th> <th>Excludes</th> </tr> <tr> <td>org.apache.hive:hive-jdbc:2.3.4</td> <td></td> </tr> <tr> <td>org.apache.hive:hive-exec:2.3.4</td> <td></td> </tr> </table> <p><a href="https://mvnrepository.com/artifact/org.apache.hive/hive-jdbc">Maven Repository : org.apache.hive:hive-jdbc</a></p> <h5>Impersonation</h5> <p>When Zeppelin server is running with authentication enabled, then the interpreter can utilize Hive's user proxy feature i.e. send extra parameter for creating and running a session ("hive.server2.proxy.user=": "${loggedInUser}"). This is particularly useful when multiple users are sharing a notebook.</p> <p>To enable this set following:</p> <ul> <li><code>default.proxy.user.property</code> as <code>hive.server2.proxy.user</code></li> </ul> <p>See <a href="../usage/interpreter/user_impersonation.html">User Impersonation in interpreter</a> for more information.</p> <h5>Sample configuration</h5> <table class="table-configuration"> <tr> <th>Name</th> <th>Value</th> </tr> <tr> <td>hive.driver</td> <td>org.apache.hive.jdbc.HiveDriver</td> </tr> <tr> <td>hive.url</td> <td>jdbc:hive2://hive-server-host:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2</td> </tr> <tr> <td>hive.proxy.user.property</td> <td>hive.server2.proxy.user</td> </tr> <tr> <td>zeppelin.jdbc.auth.type</td> <td>SIMPLE</td> </tr> </table> <h3>Presto/Trino</h3> <p>Properties</p> <table class="table-configuration"> <tr> <th>Name</th> <th>Value</th> </tr> <tr> <td>default.driver</td> <td>io.prestosql.jdbc.PrestoDriver</td> </tr> <tr> <td>default.url</td> <td>jdbc:presto://presto-server:9090/hive</td> </tr> <tr> <td>default.user</td> <td>presto_user</td> </tr> </table> <p><a href="https://trino.io/docs/current/installation/jdbc.html">Trino JDBC Driver Docs</a> <br/> <a href="https://prestodb.io/docs/current/installation/jdbc.html">Presto JDBC Driver Docs</a></p> <p>Dependencies</p> <table class="table-configuration"> <tr> <th>Artifact</th> <th>Excludes</th> </tr> <tr> <td>io.prestosql:presto-jdbc:350</td> <td></td> </tr> </table> <h3>Impala</h3> <p>Properties</p> <table class="table-configuration"> <tr> <th>Name</th> <th>Value</th> </tr> <tr> <td>default.driver</td> <td>org.apache.hive.jdbc.HiveDriver</td> </tr> <tr> <td>default.url</td> <td>jdbc:hive2://emr-header-1.cluster-47080:21050/;auth=noSasl</td> </tr> </table> <p>Dependencies</p> <table class="table-configuration"> <tr> <th>Artifact</th> <th>Excludes</th> </tr> <tr> <td>org.apache.hive:hive-jdbc:2.3.4</td> <td></td> </tr> </table> <p><a href="https://impala.apache.org/docs/build/html/topics/impala_jdbc.html">Impala JDBC Driver Docs</a></p> <p>Dependencies</p> <table class="table-configuration"> <tr> <th>Artifact</th> <th>Excludes</th> </tr> <tr> <td>io.prestosql:presto-jdbc:350</td> <td></td> </tr> </table> <h3>Apache Phoenix</h3> <p>Phoenix supports <code>thick</code> and <code>thin</code> connection types:</p> <ul> <li><a href="#thick-client-connection">Thick client</a> is faster, but must connect directly to ZooKeeper and HBase RegionServers.</li> <li><a href="#thin-client-connection">Thin client</a> has fewer dependencies and connects through a <a href="http://phoenix.apache.org/server.html">Phoenix Query Server</a> instance.</li> </ul> <p>Use the appropriate <code>default.driver</code>, <code>default.url</code>, and the dependency artifact for your connection type.</p> <h4>Thick client connection</h4> <p><img src="/docs/0.10.1/assets/themes/zeppelin/img/docs-img/phoenix_thick_setting.png" width="600px" /></p> <h5>Properties</h5> <table class="table-configuration"> <tr> <th>Name</th> <th>Value</th> </tr> <tr> <td>default.driver</td> <td>org.apache.phoenix.jdbc.PhoenixDriver</td> </tr> <tr> <td>default.url</td> <td>jdbc:phoenix:localhost:2181:/hbase-unsecure</td> </tr> <tr> <td>default.user</td> <td>phoenix_user</td> </tr> <tr> <td>default.password</td> <td>phoenix_password</td> </tr> </table> <h5>Dependencies</h5> <table class="table-configuration"> <tr> <th>Artifact</th> <th>Excludes</th> </tr> <tr> <td>org.apache.phoenix:phoenix-core:4.4.0-HBase-1.0</td> <td></td> </tr> </table> <p><a href="https://mvnrepository.com/artifact/org.apache.phoenix/phoenix-core">Maven Repository: org.apache.phoenix:phoenix-core</a></p> <h4>Thin client connection</h4> <p><img src="/docs/0.10.1/assets/themes/zeppelin/img/docs-img/phoenix_thin_setting.png" width="600px" /></p> <h5>Properties</h5> <table class="table-configuration"> <tr> <th>Name</th> <th>Value</th> </tr> <tr> <td>default.driver</td> <td>org.apache.phoenix.queryserver.client.Driver</td> </tr> <tr> <td>default.url</td> <td>jdbc:phoenix:thin:url=http://localhost:8765;serialization=PROTOBUF</td> </tr> <tr> <td>default.user</td> <td>phoenix_user</td> </tr> <tr> <td>default.password</td> <td>phoenix_password</td> </tr> </table> <h5>Dependencies</h5> <p>Before Adding one of the below dependencies, check the Phoenix version first.</p> <table class="table-configuration"> <tr> <th>Artifact</th> <th>Excludes</th> <th>Description</th> </tr> <tr> <td>org.apache.phoenix:phoenix-server-client:4.7.0-HBase-1.1</td> <td></td> <td>For Phoenix <code>4.7</code></td> </tr> <tr> <td>org.apache.phoenix:phoenix-queryserver-client:4.8.0-HBase-1.2</td> <td></td> <td>For Phoenix <code>4.8+</code></td> </tr> </table> <p><a href="https://mvnrepository.com/artifact/org.apache.phoenix/phoenix-queryserver-client">Maven Repository: org.apache.phoenix:phoenix-queryserver-client</a></p> <h3>Apache Tajo</h3> <p><img src="/docs/0.10.1/assets/themes/zeppelin/img/docs-img/tajo_setting.png" width="600px" /></p> <h5>Properties</h5> <table class="table-configuration"> <tr> <th>Name</th> <th>Value</th> </tr> <tr> <td>default.driver</td> <td>org.apache.tajo.jdbc.TajoDriver</td> </tr> <tr> <td>default.url</td> <td>jdbc:tajo://localhost:26002/default</td> </tr> </table> <p><a href="https://tajo.apache.org/docs/current/jdbc_driver.html">Apache Tajo JDBC Driver Docs</a></p> <h5>Dependencies</h5> <table class="table-configuration"> <tr> <th>Artifact</th> <th>Excludes</th> </tr> <tr> <td>org.apache.tajo:tajo-jdbc:0.11.0</td> <td></td> </tr> </table> <p><a href="https://mvnrepository.com/artifact/org.apache.tajo/tajo-jdbc">Maven Repository: org.apache.tajo:tajo-jdbc</a></p> <h2>Object Interpolation</h2> <p>The JDBC interpreter also supports interpolation of <code>ZeppelinContext</code> objects into the paragraph text. The following example shows one use of this facility:</p> <h4>In Scala cell:</h4> <div class="highlight"><pre><code class="scala language-scala" data-lang="scala"><span class="n">z</span><span class="o">.</span><span class="n">put</span><span class="o">(</span><span class="s">"country_code"</span><span class="o">,</span> <span class="s">"KR"</span><span class="o">)</span> <span class="c1">// ...</span> </code></pre></div> <h4>In later JDBC cell:</h4> <div class="highlight"><pre><code class="sql language-sql" data-lang="sql"><span class="o">%</span><span class="n">jdbc_interpreter_name</span> <span class="k">select</span> <span class="o">*</span> <span class="k">from</span> <span class="n">patents_list</span> <span class="k">where</span> <span class="n">priority_country</span> <span class="o">=</span> <span class="s1">'{country_code}'</span> <span class="k">and</span> <span class="n">filing_date</span> <span class="k">like</span> <span class="s1">'2015-%'</span> </code></pre></div> <p>Object interpolation is disabled by default, and can be enabled for all instances of the JDBC interpreter by setting the value of the property <code>zeppelin.jdbc.interpolation</code> to <code>true</code> (see <em>More Properties</em> above). More details of this feature can be found in the Spark interpreter documentation under <a href="../usage/other_features/zeppelin_context.html">Zeppelin-Context</a></p> <h2>Bug reporting</h2> <p>If you find a bug using JDBC interpreter, please create a <a href="https://issues.apache.org/jira/browse/ZEPPELIN">JIRA</a> ticket.</p> </div> </div> <hr> <footer> <!-- <p>© 2022 The Apache Software Foundation</p>--> </footer> </div> <script type="text/javascript"> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-45176241-5', 'zeppelin.apache.org'); ga('require', 'linkid', 'linkid.js'); ga('send', 'pageview'); </script> </body> </html>