Simba JDBC Driver For Hive Install Guide
Simba JDBC Driver For Hive Install Guide
SQL Connector
Version 1.0.36
March 24, 2016
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
www.simba.com 2
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
Purpose
The Simba Apache Hive JDBC Driver with SQL Connector Installation and
Configuration Guide explains how to install and configure the Simba Apache Hive
JDBC Driver with SQL Connector on all supported platforms. The guide also provides
details related to features of the driver.
Audience
The guide is intended for end users of the Simba Apache Hive JDBC Driver with SQL
Connector.
Knowledge Prerequisites
To use the Simba Apache Hive JDBC Driver with SQL Connector, the following
knowledge is helpful:
l Familiarity with the platform on which you are using the Simba Apache Hive
JDBC Driver with SQL Connector
l Ability to use the data store to which the Simba Apache Hive JDBC Driver with
SQL Connector is connecting
l An understanding of the role of JDBCtechnologies in connecting to a data store
l Experience creating and configuring JDBCconnections
l Exposure to SQL
Document Conventions
Italics are used when referring to book and document titles.
Bold is used in procedures for graphical user interface elements that a user clicks and
text that a user types.
Monospace font indicates commands, source code or contents of text files.
Underline is not used.
The pencil icon indicates a short note appended to a paragraph.
The star icon indicates an important comment related to the preceding paragraph.
www.simba.com 3
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
Table of Contents
Introduction 6
System Requirements 7
Using the Simba Apache Hive JDBC Driver with SQL Connector 9
Setting the Class Path 9
Initializing the Driver Class 9
Building the Connection URL 11
Configuring Authentication 12
Using No Authentication 12
Using Kerberos 12
Using User Name 13
Using User Name And Password 13
Authentication Options 14
Configuring Kerberos Authentication for Windows 16
Kerberos Encryption Strength and the JCE Policy Files Extension 21
Configuring SSL 23
Configuring Logging 25
Features 27
SQL Query versus HiveQL Query 27
Data Types 27
Catalog and Schema Support 28
Contact Us 29
www.simba.com 4
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
DelegationUID 32
httpPath 33
KrbHostFQDN 33
KrbRealm 33
KrbServiceName 34
LogLevel 34
LogPath 35
PreparedMetaLimitZero 35
PWD 35
RowsFetchedPerBlock 36
SocketTimeout 36
SSL 36
SSLKeyStore 37
SSLKeyStorePwd 37
SSLTrustStore 37
SSLTrustStorePwd 38
transportMode 38
UID 39
UseNativeQuery 39
zk 39
Third-Party Trademarks 41
Third-Party Licenses 42
www.simba.com 5
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
Introduction
The Simba Apache Hive JDBC Driver with SQL Connector is used for direct SQL and
HiveQL access to Apache Hadoop / Hive distributions, enabling Business Intelligence
(BI), analytics, and reporting on Hadoop / Hive-based data. The driver efficiently
transforms an applications SQL query into the equivalent form in HiveQL, which is a
subset of SQL-92. If an application is Hive-aware, then the driver is configurable to
pass the query through to the database for processing. The driver interrogates Hive to
obtain schema information to present to a SQL-based application. Queries, including
joins, are translated from SQL to HiveQL. For more information about the differences
between HiveQL and SQL, see Features on page 27.
The Simba Apache Hive JDBC Driver with SQL Connector complies with the JDBC
3.0, 4.0 and 4.1 data standards. JDBC is one of the most established and widely
supported APIs for connecting to and working with databases. At the heart of the
technology is the JDBC driver, which connects an application to the database. For
more information about JDBC, see the Data Access Standards Glossary:
http://www.simba.com/resources/data-access-standards-library.
This guide is suitable for users who want to access data residing within Hive from their
desktop environment. Application developers might also find the information helpful.
Refer to your application for details on connecting via JDBC.
www.simba.com 6
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
System Requirements
Each machine where you use the Simba Apache Hive JDBC Driver with SQL
Connector must have Java Runtime Environment (JRE) installed. The version of JRE
that must be installed depends on the version of the JDBC API you are using with the
driver. The following table lists the required version of JRE for each version of the
JDBC API.
www.simba.com 7
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
o hive_service.jar
o HiveJDBC[APIVersion].jar
o libfb303-[LibVersion].jar
o libthrift-[LibVersion].jar
o log4j-[LibVersion].jar
o ql.jar
o slf4j-api-[LibVersion].jar
o slf4j-log4j12-[LibVersion].jar
o TCLIServiceClient.jar
o zookeeper-[LibVersion].jar
www.simba.com 8
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
The Simba Apache Hive JDBC Driver with SQL Connector provides read-only
access to Hive data.
www.simba.com 9
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
To support JDBC 4.0, classes with the following FQCNs are available:
l com.simba.hive.jdbc4.HS1Driver
l com.simba.hive.jdbc4.HS2Driver
l com.simba.hive.jdbc4.HS1DataSource
l com.simba.hive.jdbc4.HS2DataSource
To support JDBC 4.1, classes with the following FQCNs are available:
l com.simba.hive.jdbc41.HS1Driver
l com.simba.hive.jdbc41.HS2Driver
l com.simba.hive.jdbc41.HS1DataSource
l com.simba.hive.jdbc41.HS2DataSource
The following sample code shows how to use the DriverManager to establish a
connection:
private static Connection connectViaDM() throws Exception
{
Connection connection = null;
Class.forName(DRIVER_CLASS);
connection = DriverManager.getConnection(CONNECTION_
URL);
return connection;
}
The following sample code shows how to use the DataSource class to establish a
connection:
private static Connection connectViaDS() throws Exception
{
Connection connection = null;
Class.forName(DRIVER_CLASS);
DataSource ds = new com.simba.hive.jdbc4.HS1DataSource
();
ds.setURL(CONNECTION_URL);
connection = ds.getConnection();
return connection;
}
www.simba.com 10
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
By default, the driver uses the schema named default and authenticates the
connection using the user name anonymous.
You can specify optional settings such as the number of the schema to use or any of
the connection properties supported by the driver. For a list of the properties available
in the driver, see Driver Configuration Options on page 30.
If you specify a property that is not supported by the driver, then the driver attempts
to apply the property as a Hive server-side property for the client session. For more
information, see Configuring Server-Side Properties on page 24.
The following is the format of a connection URL that specifies some optional settings:
jdbc:[Subprotocol]://[Host]:[Port]/[Schema];[Property1]=
[Value];[Property2]=[Value];...
For example, to connect to port 11000 on a Hive Server 2 instance installed on the
local machine, use a schema named default2, and authenticate the connection using a
user name and password, you would use the following connection URL:
jdbc:hive2://localhost:11000/default2;AuthMech=3;
UID=simba;PWD=simba
Be aware of the following:
l Properties are case-sensitive.
l Do not duplicate properties in the connection URL.
www.simba.com 11
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
Configuring Authentication
The Simba Apache Hive JDBC Driver with SQL Connector supports the following
authentication mechanisms:
l No Authentication
l Kerberos
l User Name
l User Name And Password
You configure the authentication mechanism that the driver uses to connect to Hive by
specifying the relevant properties in the connection URL.
For information about selecting an appropriate authentication mechanism when using
the Simba Apache Hive JDBC Driver with SQL Connector, see Authentication Options
on page 14.
For information about the properties you can use in the connection URL, see Driver
Configuration Options on page 30.
In addition to authentication, you can configure the driver to connect over SSL. For
more information, see Configuring SSL on page 23.
Using No Authentication
When connecting to a Hive server of type Hive Server 1, you must use No
Authentication.
Using Kerberos
Kerberos must be installed and configured before you can use this authentication
mechanism. For information about configuring and operating Kerberos on Windows,
see Configuring Kerberos Authentication for Windows on page 16. For other operating
systems, see the MIT Kerberos documentation: http://web.mit.edu/kerberos/krb5-
latest/doc/.
www.simba.com 12
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
www.simba.com 13
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
Authentication Options
Hive Server 1 does not support authentication. You must configure the driver to use No
Authentication.
Hive Server 2 supports the following authentication mechanisms:
l No Authentication
l Kerberos
l User Name
l User Name And Password
Most default configurations of Hive Server 2 require User Name authentication. If you
are unable to connect to your Hive server using User Name authentication, then verify
the authentication mechanism configured for your Hive server by examining the hive-
site.xml file. Examine the following properties to determine which authentication
mechanism your server is set to use:
l hive.server2.authentication: This property sets the authentication
mode for Hive Server 2. The following values are available:
o NOSASL disables the Simple Authentication and Security Layer (SASL).
www.simba.com 14
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
Using No Authentication
When hive.server2.authentication is set to NOSASL, you must configure
your connection to use No Authentication.
Using Kerberos
When connecting to a Hive server of type Hive Server 2 and
hive.server2.authentication is set to KERBEROS, you must configure your
connection to use Kerberos authentication.
www.simba.com 15
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
www.simba.com 16
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
www.simba.com 17
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
www.simba.com 18
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
www.simba.com 19
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
/**
* Logic executed in this method will have access to
the
* Subject that is used to "doAs". The driver will get
* the Subject and use it for establishing a connection
* with the server.
*/
@Override
public Void run()
{
try
{
// Establish a connection using the connection URL
con = DriverManager.getConnection(ConnectionURL);
}
catch (SQLException e)
{
// Handle errors that are encountered during
// interaction with the data store
e.printStackTrace();
}
catch (Exception e)
{
// Handle other errors
e.printStackTrace();
}
return null;
}
}
www.simba.com 20
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
2. Run the PrivilegedAction using the existing Subject, and then use the
connection.
For example:
// Create the action
AuthenticateDriverAction authenticateAction = new
AuthenticateDriverAction();
// Establish the connection using the Subject for
// authentication.
Subject.doAs(loginConfig.getSubject(),
authenticateAction);
// Use the established connection.
authenticateAction.con;
www.simba.com 21
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
www.simba.com 22
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
Configuring SSL
If you are connecting to a Hive server that has Secure Sockets Layer (SSL) enabled,
then you can configure the driver to connect to an SSL-enabled socket.
SSL connections require a KeyStore and a TrustStore. You can create a TrustStore
and configure the driver to use it, or allow the driver to use one of the default
TrustStores. If you do not configure the driver to use a specific TrustStore, then the
driver uses the Java TrustStore jssecacerts. If jssecacerts is not available, then the
driver uses cacerts instead.
To configure SSL:
1. Create a KeyStore and configure the driver to use it:
a. Create a KeyStore containing your signed, trusted SSL certificate.
b. Set the SSLKeyStore property to the full path of the KeyStore, including
the file name.
c. Set the SSLKeyStorePwd property to the password for the KeyStore.
2. Optionally, create a TrustStore and configure the driver to use it:
a. Create a TrustStore containing your signed, trusted SSL certificate.
b. Set the SSLTrustStore property to the full path of the TrustStore,
including the file name.
c. Set the SSLTrustStorePwd property to the password for the TrustStore.
3. Set the SSL property to 1.
4. Optionally, to disable host name verification, set the AllowAllHostNames
property to 1.
For security reasons, it is strongly recommended that you do not disable host
name verification.
5. Optionally, to allow the SSL certificate used by the server to be self-signed, set
the AllowSelfSignedCerts property to 1.
6. Optionally, to allow the common name of a CA-issued certificate to not match the
host name of the Hive server, set the CAIssuedCertNamesMismatch
property to 1.
For self-signed certificates, the driver always allows the common name of the
certificate to not match the host name.
For example:
jdbc:hive2://localhost:10000;AuthMech=3;SSL=1;
SSLKeyStore=C:\\Users\\bsmith\\Desktop\\keystore.jks;
SSLKeyStorePwd=*****;UID=hs2;PWD=*****
For more information about the connection properties used in SSL connections,
see Driver Configuration Options on page 30
www.simba.com 23
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
www.simba.com 24
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
Configuring Logging
To help troubleshoot issues, you can enable logging in the driver.
Only enable logging long enough to capture an issue. Logging decreases
performance and can consume a large quantity of disk space.
Set the LogLevel key in your connection URL to enable logging and specify the
amount of detail included in log files. The following table lists the logging levels
provided by the Simba Apache Hive JDBC Driver with SQL Connector, in order from
least verbose to most verbose.
2 Log error events that might allow the driver to continue run-
ning.
To enable logging:
1. Set the LogLevel property to the desired level of information to include in log
files.
2. Set the LogPath property to the full path to the folder where you want to save
log files.
For example, the following connection URLenables logging level 3 and saves
the log files in the C:\temp folder:
jdbc:hive://localhost:11000;LogLevel=3;LogPath=C:\temp
3. To make sure that the new settings take effect, restart your JDBC application and
reconnect to the server.
www.simba.com 25
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
The Simba Apache Hive JDBC Driver with SQL Connector produces the
following log files in the location specified in the LogPath property:
l A HiveJDBC_driver.log file that logs driver activity that is not specific
to a connection.
l A HiveJDBC_connection_[Number].log file for each connection
made to the database, where [Number] is a number that identifies each log
file. This file logs driver activity that is specific to the connection.
If the LogPath value is invalid, then the driver sends the logged information to the
standard output stream (System.out).
To disable logging:
1. Remove the LogLevel and LogPath properties from the connection URL.
2. To make sure that the new settings take effect, restart your JDBC application and
reconnect to the server.
www.simba.com 26
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
Features
More information is provided on the following features of the Simba Apache Hive
JDBC Driver with SQL Connector:
l SQL Query versus HiveQL Query on page 27
l Data Types on page 27
l Catalog and Schema Support on page 28
Data Types
The Simba Apache Hive JDBC Driver with SQL Connector supports many common
data formats, converting between Hive, SQL, and Java data types.
The following table lists the supported data type mappings.
www.simba.com 27
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
The aggregate types (ARRAY, MAP, STRUCT, and UNIONTYPE) are not yet
supported. Columns of aggregate types are treated as VARCHAR columns in SQL and
STRING columns in Java.
www.simba.com 28
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
Contact Us
If you have difficulty using the driver, please contact our Technical Support staff. We
welcome your questions, comments, and feature requests.
Technical Support is available Monday to Friday from 8 a.m. to 6 p.m. Pacific Time.
To help us assist you, prior to contacting Technical Support please prepare a
detailed summary of the client and server environment including operating system
version, patch level, and configuration.
You can contact Technical Support via:
l E-mail: [email protected]
l Web site: www.simba.com
l Telephone: (604) 633-0008 Extension 3
l Fax: (604) 633-0004
You can also follow us on Twitter @SimbaTech
www.simba.com 29
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
AllowAllHostNames
Default Value Data Type Required
0 Integer No
Description
This property specifies whether host name verification is enabled for SSLconnections.
l 0:Host name verification is enabled, so the driver requires the host name
specified in the SSLcertificate to match the domain of the URL being requested.
l 1: Host name verification is disabled, so the driver accepts all host names.
For security reasons, it is strongly recommended that you do not disable host name
verification.
This property is applicable only when SSL connections are enabled.
AllowSelfSignedCerts
Default Value Data Type Required
0 Integer No
Description
This property specifies whether the driver allows the server to use self-signed
SSLcertificates.
l 0:The driver does not allow self-signed certificates.
l 1: The driver allows self-signed certificates.
www.simba.com 30
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
AuthMech
Default Value Data Type Required
Description
The authentication mechanism to use. Set the value to one of the following numbers:
l 0 for No Authentication.
l 1 for Kerberos.
l 2 for User Name.
l 3 for User Name And Password.
CAIssuedCertNamesMismatch
Default Value Data Type Required
0 Integer No
Description
This property specifies whether the driver requires the name of the CA-issued SSL
certificate to match the host name of the Hive server.
l 0:The driver requires the names to match.
l 1:The driver allows the names to mismatch.
CatalogSchemaSwitch
Default Value Data Type Required
1 Integer No
www.simba.com 31
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
Description
This property specifies whether the driver treats Hive catalogs as schemas or as
catalogs.
l 1:The driver treats Hive catalogs as schemas as a restriction for filtering.
l 0: Hive catalogs are treated as catalogs, and Hive schemas are treated as
schemas.
DecimalColumnScale
Default Value Data Type Required
10 Integer No
Description
The maximum number of digits to the right of the decimal point for numeric data types.
DefaultStringColumnLength
Default Value Data Type Required
255 Integer No
Description
The maximum number of characters that can be contained in STRING columns. The
range of DefaultStringColumnLength is 0 to 32767.
By default, the columns metadata for Hive does not specify a maximum data length for
STRING columns.
DelegationUID
Default Value Data Type Required
None String No
Description
Use this option to delegate all operations against Hive to a user that is different than
the authenticated user for the connection.
This option is applicable only when connecting to a Hive Server 2 instance that
supports this feature.
www.simba.com 32
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
httpPath
Default Value Data Type Required
Description
The partial URL corresponding to the Hive server.
The driver forms the HTTPaddress to connect to by appending the httpPath value
to the host and port specified in the connection URL. For example, to connect to the
HTTP address http://localhost:10002/cliservice, you would use the
following connection URL:
jdbc:hive2://localhost:10002;AuthMech=3;
transportMode=http;httpPath=cliservice;UID=hs2;PWD=simba;
By default, Hive servers use cliservice as the partial URL.
KrbHostFQDN
Default Value Data Type Required
Description
The fully qualified domain name of the Hive Server 2 host.
KrbRealm
Default Value Data Type Required
Description
The realm of the Hive Server 2 host.
If your Kerberos configuration already defines the realm of the Hive Server 2 host as
the default realm, then you do not need to configure this option.
www.simba.com 33
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
KrbServiceName
Default Value Data Type Required
Description
The Kerberos service principal name of the Hive server.
LogLevel
Default Value Data Type Required
0 Integer No
Description
Use this property to enable or disable logging in the driver and to specify the amount of
detail included in log files.
Only enable logging long enough to capture an issue. Logging decreases
performance and can consume a large quantity of disk space.
Set the property to one of the following numbers:
l 0: Disable all logging.
l 1: Enable logging on the FATAL level, which logs very severe error events that
will lead the driver to abort.
l 2:Enable logging on the ERROR level, which logs error events that might still
allow the driver to continue running.
l 3:Enable logging on the WARNING level, which logs potentially harmful
situations.
l 4:Enable logging on the INFO level, which logs general information that
describes the progress of the driver.
l 5:Enable logging on the DEBUG level, which logs detailed information that is
useful for debugging the driver.
l 6:Enable logging on the TRACE level, which logs all driver activity.
When logging is enabled, the driver produces the following log files in the location
specified in the LogPath property:
l A HiveJDBC_driver.log file that logs driver activity that is not specific to a
connection.
www.simba.com 34
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
LogPath
Default Value Data Type Required
Description
The full path to the folder where the driver saves log files when logging is enabled.
PreparedMetaLimitZero
Default Value Data Type Required
0 Integer No
Description
This property specifies whether the PreparedStatement.getMetadata() call
will request metadata from the server with LIMIT 0.
l 1: The PreparedStatement.getMetadata() call uses LIMIT 0.
l 0: The PreparedStatement.getMetadata() call does not use LIMIT 0.
PWD
Default Value Data Type Required
Description
The password corresponding to the user name that you provided using the property
UID on page 39.
If you set the AuthMech to 3, the default PWD value is not used and you must
specify a password.
www.simba.com 35
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
RowsFetchedPerBlock
Default Value Data Type Required
10000 Integer No
Description
The maximum number of rows that a query returns at a time.
Any positive 32-bit integer is a valid value, but testing has shown that performance
gains are marginal beyond the default value of 10000 rows.
SocketTimeout
Default Value Data Type Required
30 Integer No
Description
The number of seconds after which Hive closes the connection with the client
application if the connection is idle.
When this property is set to 0, idle connections are not closed.
SSL
Default Value Data Type Required
0 Integer No
Description
This property specifies whether the driver communicates with the Hive server through
an SSL-enabled socket.
l 1: The driver connects to SSL-enabled sockets.
l 0: The driver does not connect to SSL-enabled sockets.
www.simba.com 36
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
SSLKeyStore
Default Value Data Type Required
Description
The full path and file name of the Java KeyStore containing an SSL certificate to use
during authentication.
See also the property SSLKeyStorePwd on page 37.
SSLKeyStorePwd
Default Value Data Type Required
Description
The password for accessing the Java KeyStore that you specified using the property
SSLKeyStore on page 37.
SSLTrustStore
Default Value Data Type Required
jssecacerts, if it String No
exists.
If jssecacerts does
not exist, then cacerts
is used. The default
location of cacerts is
jre\lib\security\.
Description
The full path and file name of the Java TrustStore containing an SSL certificate to use
during authentication.
See also the property SSLTrustStorePwd on page 38.
www.simba.com 37
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
SSLTrustStorePwd
Default Value Data Type Required
Description
The password for accessing the Java TrustStore that you specified using the property
SSLTrustStore on page 37.
transportMode
Default Value Data Type Required
sasl String No
Description
The transport protocol to use in the Thrift layer.
l binary: The driver uses the Binary transport protocol.
When connecting to a Hive Server 1 instance, you must use this setting. If you
use this setting but do not specify the AuthMech property, then the driver uses
AuthMech=0 by default. This setting is valid only when the AuthMech property
is set to 0 or 3.
l sasl: The driver uses the SASL transport protocol.
If you use this setting but do not specify the AuthMech property, then the driver
uses AuthMech=2 by default. This setting is valid only when the AuthMech
property is set to 1, 2, or 3.
l http:The driver uses the HTTPtransport protocol.
When connecting to Hive through the Apache Knox Gateway, you must use this
setting. If you use this setting but do not specify the AuthMech property, then the
driver uses AuthMech=3 by default. This setting is valid only when the
AuthMech property is set to 3.
If you set this property to http, then the port number in the connection
URLcorresponds to the HTTPport rather than the TCP port, and you must
specify the httpPath property. For more information, see httpPath on page 33.
www.simba.com 38
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
UID
Default Value Data Type Required
Description
The user name that you use to access the Hive server.
If you set the AuthMech to 3, the default UID value is not used and you must
specify a user name.
UseNativeQuery
Default Value Data Type Required
0 Integer No
Description
This property specifies whether the driver transforms the queries emitted by
applications.
l 1: The driver does not transform the queries emitted by applications, so the
native query is used.
l 0:The driver transforms the queries emitted by applications and converts them
into an equivalent form in HiveQL.
If the application is Hive-aware and already emits HiveQL, then enable this option
to avoid the extra overhead of query transformation.
zk
Default Value Data Type Required
None String No
Description
The connection string to one or more ZooKeeper quorums, written in the following
format where [ZK_IP] is the IPaddress, [ZK_Port] is the port number, and [ZK_
Namespace] is the namespace:
[ZK_IP]:[ZK_Port]/[ZK_Namespace]
www.simba.com 39
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
For example:
jdbc:hive2://zk=192.168.0.1:2181/hiveserver2
Use this option to enable the Dynamic Service Discovery feature, which allows you to
connect to Hive servers that are registered against a ZooKeeper service by connecting
to the ZooKeeper service.
You can specify multiple quorums in a comma-separated list. If connection to a quorum
fails, the driver will attempt to connect to the next quorum in the list.
www.simba.com 40
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
Third-Party Trademarks
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names
may be trademarks of their respective owners.
Apache Hive, Apache, and Hive are trademarks or registered trademarks of The
Apache Software Foundation or its subsidiaries in Canada, United States and/or other
countries.
All other trademarks are trademarks of their respective owners.
www.simba.com 41
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
Third-Party Licenses
The licenses for the third-party libraries that are included in this product are listed
below.
Simple Logging Faade for Java (SLF4J) License
Copyright 2004-2015 QOS.ch
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies
or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Apache License, Version 2.0
The following notice is included in compliance with the Apache License, Version 2.0
and is applicable to all software licensed under the Apache License, Version 2.0.
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that
control, are controlled by, or are under common control with that entity. For the
www.simba.com 42
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
purposes of this definition, "control" means (i) the power, direct or indirect, to cause
the direction or management of such entity, whether by contract or otherwise, or (ii)
ownership of fifty percent (50%) or more of the outstanding shares, or (iii)
beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions
granted by this License.
"Source" form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.
"Object" form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included in
or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is
based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an original
work of authorship. For the purposes of this License, Derivative Works shall not
include works that remain separable from, or merely link (or bind by name) to the
interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of
the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work by the
copyright owner or by an individual or Legal Entity authorized to submit on behalf
of the copyright owner. For the purposes of this definition, "submitted" means any
form of electronic, verbal, or written communication sent to the Licensor or its
representatives, including but not limited to communication on electronic mailing
lists, source code control systems, and issue tracking systems that are managed
by, or on behalf of, the Licensor for the purpose of discussing and improving the
Work, but excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of
whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License,
each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-
charge, royalty-free, irrevocable copyright license to reproduce, prepare
Derivative Works of, publicly display, publicly perform, sublicense, and distribute
the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each
Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-
www.simba.com 43
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
www.simba.com 44
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
supersede or modify the terms of any separate license agreement you may have
executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names,
trademarks, service marks, or product names of the Licensor, except as required
for reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing,
Licensor provides the Work (and each Contributor provides its Contributions) on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied, including, without limitation, any warranties or
conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS
FOR A PARTICULAR PURPOSE. You are solely responsible for determining
the appropriateness of using or redistributing the Work and assume any risks
associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort
(including negligence), contract, or otherwise, unless required by applicable law
(such as deliberate and grossly negligent acts) or agreed to in writing, shall any
Contributor be liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a result of this
License or out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or
Derivative Works thereof, You may choose to offer, and charge a fee for,
acceptance of support, warranty, indemnity, or other liability obligations and/or
rights consistent with this License. However, in accepting such obligations, You
may act only on Your own behalf and on Your sole responsibility, not on behalf of
any other Contributor, and only if You agree to indemnify, defend, and hold each
Contributor harmless for any liability incurred by, or claims asserted against, such
Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate notice,
with the fields enclosed by brackets "[]" replaced with your own identifying
information. (Don't include the brackets!) The text should be enclosed in the
appropriate comment syntax for the file format. We also recommend that a file or
class name and description of purpose be included on the same "printed page" as
the copyright notice for easier identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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
www.simba.com 45
Simba Apache Hive JDBC Driver with SQL
Installation and Configuration Guide
Connector
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.
This product includes software that is licensed under the Apache License, Version 2.0
(listed below):
Apache Commons
Copyright 2001-2015 The Apache Software Foundation
www.simba.com 46