Cloudera JDBC Driver for Impala
Version 2.5.16
Important Notice
© 2010-2015 Cloudera, Inc. All rights reserved.
Cloudera, the Cloudera logo, Cloudera Impala, Impala, and any other product or service names or
slogans contained in this document, except as otherwise disclaimed, are trademarks of Cloudera and its
suppliers or licensors, and may not be copied, imitated or used, in whole or in part, without the prior
written permission of Cloudera or the applicable trademark holder.
Hadoop and the Hadoop elephant logo are trademarks of the Apache Software Foundation. All other
trademarks, registered trademarks, product names and company names or logos mentioned in this
document are the property of their respective owners. Reference to any products, services, processes or
other information, by trade name, trademark, manufacturer, supplier or otherwise does not constitute
or imply endorsement, sponsorship or recommendation thereof by us.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights
under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval
system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or
otherwise), or for any purpose, without the express written permission of Cloudera.
Cloudera may have patents, patent applications, trademarks, copyrights, or other intellectual property
rights covering subject matter in this document. Except as expressly provided in any written license
agreement from Cloudera, the furnishing of this document does not give you any license to these
patents, trademarks copyrights, or other intellectual property.
The information in this document is subject to change without notice. Cloudera shall not be liable for
any damages resulting from technical errors or omissions which may be present in this document, or
from use of this document.
Cloudera, Inc.
1001 Page Mill Road, Building 2
Palo Alto, CA 94304-1008
info@cloudera.com
US: 1-888-789-1488
Intl: 1-650-843-0595
www.cloudera.com
Release Information
Version: 2.5.16
Date: January 22, 2015
Table of Contents
INTRODUCTION ..................................................................................................................................................... 1
SYSTEM REQUIREMENTS ....................................................................................................................................... 1
CLOUDERA JDBC DRIVER FOR IMPALA FILES .......................................................................................................... 1
USING THE CLOUDERA JDBC DRIVER FOR IMPALA ................................................................................................. 3
SETTING THE CLASS PATH ................................................................................................................................................ 3
INITIALIZING THE DRIVER CLASS ......................................................................................................................................... 3
BUILDING THE CONNECTION URL ...................................................................................................................................... 4
JAVA SAMPLE CODE ............................................................................................................................................... 4
CONFIGURING AUTHENTICATION .......................................................................................................................... 7
USING NO AUTHENTICATION ............................................................................................................................................ 8
USING KERBEROS ........................................................................................................................................................... 8
USING USER NAME ........................................................................................................................................................ 8
USING USER NAME AND PASSWORD .................................................................................................................................. 9
USING USER NAME AND PASSWORD WITH SECURE SOCKETS LAYER ......................................................................................... 9
USING NO AUTHENTICATION WITH SECURE SOCKETS LAYER ................................................................................................. 10
FEATURES ............................................................................................................................................................ 11
DATA TYPES ................................................................................................................................................................ 11
CATALOG AND SCHEMA SUPPORT .................................................................................................................................... 12
SQL TRANSLATION ....................................................................................................................................................... 12
INTERFACES AND SUPPORTED METHODS ........................................................................................................................... 12
CallableStatement ............................................................................................................................................... 14
Connection .......................................................................................................................................................... 20
DatabaseMetaData ............................................................................................................................................ 24
DataSource .......................................................................................................................................................... 34
Driver................................................................................................................................................................... 35
ParameterMetaData ........................................................................................................................................... 36
PooledConnection ............................................................................................................................................... 37
PreparedStatement ............................................................................................................................................. 38
ResultSet ............................................................................................................................................................. 41
ResultSetMetaData ............................................................................................................................................. 53
Statement ........................................................................................................................................................... 54
CONTACT US ........................................................................................................................................................ 58
APPENDIX A: CONFIGURING KERBEROS AUTHENTICATION FOR WINDOWS ........................................................ 59
DOWNLOADING AND INSTALLING MIT KERBEROS FOR WINDOWS ......................................................................................... 59
USING THE MIT KERBEROS TICKET MANAGER TO GET TICKETS ............................................................................................. 59
Setting the KRB5CCNAME Environment Variable ............................................................................................... 59
Getting a Kerberos Ticket .................................................................................................................................... 60
Authenticating to the Impala Server ................................................................................................................... 60
USING THE DRIVER TO GET TICKETS ................................................................................................................................. 60
Deleting the KRB5CCNAME Environment Variable ............................................................................................. 60
Setting Up the Kerberos Configuration File ......................................................................................................... 61
Setting Up the JAAS Login Configuration File ...................................................................................................... 61
Authenticating to the Impala Server ................................................................................................................... 61
USING AN EXISTING SUBJECT TO AUTHENTICATE THE CONNECTION ........................................................................................ 62
APPENDIX B: DRIVER CONFIGURATION OPTIONS ................................................................................................ 64
Introduction
I
ntroduction
The Cloudera JDBC Driver for Impala is used for direct SQL and Impala SQL access to Apache
Hadoop / Impala distributions, enabling Business Intelligence (BI), analytics, and reporting on
Hadoop / Impala-based data. The driver efficiently transforms an application’s SQL query into
the equivalent form in Impala SQL, which is a subset of SQL-92. If an application is Impala-aware,
then the driver is configurable to pass the query through to the database for processing. The
driver interrogates Impala to obtain schema information to present to a SQL-based application.
Queries, including joins, are translated from SQL to Impala SQL. For more information about the
differences between Impala SQL and SQL, see Features on page 11.
The Cloudera JDBC Driver for Impala 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.
This guide is suitable for users who want to access data residing within Impala from their
desktop environment. Application developers may also find the information helpful. Refer to
your application for details on connecting via JDBC.
System Requirements
Each computer where you use the Cloudera JDBC Driver for Impala 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. Table 1 lists the required version of JRE for each
version of the JDBC API.
JDBC API version JRE version
3.0 1.4 or 5.0
4.0 6.0
4.1 7.0
Table 1 System Requirements
The driver is suitable for use with all versions of Cloudera Impala.
Cloudera JDBC Driver for Impala Files
The Cloudera JDBC Driver for Impala is delivered in the following three ZIP archives, where
version is the version number of the driver:
• Cloudera_ImpalaJDBC3_version .zip
• Cloudera_ImpalaJDBC4_version .zip
• Cloudera_ImpalaJDBC41_version.zip
Cloudera JDBC Driver for Impala | 1