Top Banner
DataStax ODBC driver for Apache Cassandra and DataStax Enterprise with CQL connector Install Guide DataStax March 30, 2015
40

DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL...

Jul 24, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

DataStax ODBC driver for ApacheCassandra and DataStax Enterprise

with CQL connector

Install Guide

DataStax

March 30, 2015

Page 2: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Copyright © 2015 Simba Technologies Inc. All Rights Reserved.

Information in this document is subject to change without notice. Companies, names anddata used in examples herein are fictitious unless otherwise noted. No part of thispublication, or the software it describes, may be reproduced, transmitted, transcribed,stored in a retrieval system, decompiled, disassembled, reverse-engineered, or translatedinto any language in any form by any means for any purpose without the express writtenpermission of Simba Technologies Inc.

Trademarks

Simba, the Simba logo, SimbaEngine, SimbaEngine C/S, SimbaExpress and SimbaLibare registered trademarks of Simba Technologies Inc. All other trademarks and/orservicemarks are the property of their respective owners.

Contact Us

Simba Technologies Inc.938 West 8th AvenueVancouver, BC CanadaV5Z 1E5

Tel: +1 (604) 633-0008

Fax: +1 (604) 633-0004

www.simba.com

ICU License - ICU 1.8.1 and later

COPYRIGHT AND PERMISSION NOTICE

Copyright (c) 1995-2010 International Business Machines Corporation and others. Allrights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of thissoftware and associated documentation files (the "Software"), to deal in the Softwarewithout restriction, including without limitation the rights to use, copy, modify, merge,publish, distribute, and/or sell copies of the Software, and to permit persons to whom theSoftware is furnished to do so, provided that the above copyright notice(s) and thispermission notice appear in all copies of the Software and that both the above copyrightnotice(s) and this permission notice appear in supporting documentation.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THECOPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FORANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, ORANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA ORPROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER

www.datastax.com 2

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 3: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE ORPERFORMANCE OF THIS SOFTWARE.

Except as contained in this notice, the name of a copyright holder shall not be used inadvertising or otherwise to promote the sale, use or other dealings in this Software withoutprior written authorization of the copyright holder.

All trademarks and registered trademarks mentioned herein are the property of theirrespective owners.

OpenSSL

Copyright (c) 1998-2008 The OpenSSL Project. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, arepermitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list ofconditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list ofconditions and the following disclaimer in the documentation and/or other materialsprovided with the distribution.

3. All advertising materials mentioning features or use of this software must display thefollowing acknowledgment:"This product includes software developed by the OpenSSL Project for use in theOpenSSL Toolkit. (http://www.openssl.org/)"

4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to endorseor promote products derived from this software without prior written permission. Forwritten permission, please contact [email protected].

5. Products derived from this software may not be called "OpenSSL" nor may"OpenSSL" appear in their names without prior written permission of the OpenSSLProject.

6. Redistributions of any form whatsoever must retain the following acknowledgment:"This product includes software developed by the OpenSSL Project for use in theOpenSSL Toolkit (http://www.openssl.org/)"

THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT "AS IS" AND ANYEXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THEIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULARPURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR ITSCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITEDTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ONANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ORTORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OFTHE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCHDAMAGE.

www.datastax.com 3

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 4: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Apache Cassandra

Copyright 2009-2010 The Apache Software Foundation.

Expat

Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd

Permission is hereby granted, free of charge, to any person obtaining a copy of thissoftware and associated documentation files (the "Software"), to deal in the Softwarewithout 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 towhom 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 orsubstantial 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 OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNOINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHTHOLDERS 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 OTHERDEALINGS IN THE SOFTWARE.

Contact Us

For information about contacting DataStax, go tohttp://www.datastax.com/company#contact

www.datastax.com 4

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 5: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

About This Guide

Purpose

The DataStax ODBC driver for Apache Cassandra and DataStax Enterprise with CQLconnector Install Guide explains how to install and configure the DataStax ODBC driverfor Apache Cassandra and DataStax Enterprise with CQL connector on all supportedplatforms. The guide also provides details related to features of the driver.

Audience

The guide is intended for end users of the DataStax ODBC driver for Apache Cassandraand DataStax Enterprise with CQL connector, as well as administrators and developersimplementing the driver.

Knowledge Prerequisites

To use the DataStax ODBC driver for Apache Cassandra and DataStax Enterprise withCQL connector, the following knowledge is helpful:

l Familiarity with the platform on which you are using the DataStax ODBC driver forApache Cassandra and DataStax Enterprise with CQL connector

l Ability to use the data source to which the DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise with CQL connector is connecting

l An understanding of the role of ODBC technologies and driver managers in con-necting to a data source

l Experience creating and configuring ODBC connectionsl 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 textthat 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.

The thumbs up icon indicates a practical tip or suggestion.

www.datastax.com 5

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 6: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Table of Contents

Introduction 8

Windows Driver 9System Requirements 9Installing the Driver 9Verifying the Version Number 10Creating a Data Source Name 10Configuring Advanced Options 11Configuring SSL Verification 13Configuring Logging Options 14

Linux Driver 17System Requirements 17Installing the Driver 17Verifying the Version Number 18Setting the LD_LIBRARY_PATH Environment Variable 18Configuring ODBC Connections for Non-Windows Platforms 19

Features 26CQL Connector 26Data Types 26Virtual Tables 27Write-Back 29TRUNCATE TABLE 29Query Modes 30Authentication 30Catalog and Schema Support 30

Known Issues 31

Contact Us 32

Appendix A Driver Configuration Options 33Binary Column Length 33Client-side Certificate 34Client-side Private Key 34Default Keyspace 34Enable Paging 34

www.datastax.com 6

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 7: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Enable Server Hostname Verification 35Host 35Key File Password 35Mechanism 36Password 36Port 36Query Mode 37Rows Per Page 37SSL 37String Column Length 38Trusted CA Certificates 38Tunable Consistency 38Use SQL_WVARCHAR for String Data Types 39User Name 39Virtual Table Name Separator 40

www.datastax.com 7

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 8: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Introduction

The DataStax ODBC driver for Apache Cassandra and DataStax Enterprise with CQLconnector enables Business Intelligence (BI), analytics, and reporting on data that isstored in Apache Cassandra databases. The driver complies with the ODBC 3.80 datastandard and adds important functionality such as Unicode, as well as 32- and 64-bitsupport for high-performance computing environments on all platforms.

ODBC is one the most established and widely supported APIs for connecting to andworking with databases. At the heart of the technology is the ODBC driver, which connectsan application to the database. For more information about ODBC, seehttp://www.simba.com/resources/data-access-standards-library. For completeinformation about the ODBC specification, see the ODBC API Reference athttp://msdn.microsoft.com/en-us/library/windows/desktop/ms714562(v=vs.85).aspx.

The DataStax ODBC driver for Apache Cassandra and DataStax Enterprise with CQLconnector is available for Microsoft® Windows® and Linux platforms.

The Install Guide is suitable for users who are looking to access data residing withinCassandra from their desktop environment. Application developers may also find theinformation helpful. Refer to your application for details on connecting via ODBC.

www.datastax.com 8

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 9: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Windows Driver

System Requirements

You install the DataStax ODBC driver for Apache Cassandra and DataStax Enterprisewith CQL connector on client computers accessing data in Cassandra databases. Eachcomputer where you install the driver must meet the following minimum systemrequirements:

l One of the following operating systems (32- and 64-bit editions are supported):o Windows XP with SP3o Windows Vistao Windows 7 Professionalo Windows Server 2008 R2

l 30 MB of available disk space

To install the driver, you must have Administrator privileges on the computer.

DataStax ODBC driver for Apache Cassandra and DataStax Enterprise with CQLconnector version 1.0.0 supports Apache Cassandra 2.0 and later.

Installing the Driver

On 64-bit Windows operating systems, you can execute 32- and 64-bit applicationstransparently. You must use the version of the driver matching the bitness of the clientapplication accessing data in Cassandra:

l DataStaxCassandraODBC32.msi for 32-bit applicationsl DataStaxCassandraODBC64.msi for 64-bit applications

You can install both versions of the driver on the same computer.

For an explanation of how to use ODBC on 64-bit editions of Windows, seehttp://www.simba.com/wp-content/uploads/2010/10/HOW-TO-32-bit-vs-64-bit-ODBC-Data-Source-Administrator.pdf

To install the DataStax ODBC driver for Apache Cassandra and DataStaxEnterprise with CQL connector:

1. Depending on the bitness of your client application, double-click to runDataStaxCassandraODBC32.msi or DataStaxCassandraODBC64.msi

2. Click Next3. Select the check box to accept the terms of the License Agreement if you agree, and

then click Next4. To change the installation location, click Change, then browse to the desired folder,

and then click OK. To accept the installation location, click Next

www.datastax.com 9

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 10: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

5. Click Install6. When the installation completes, click Finish

Verifying the Version Number

If you need to verify the version of the DataStax ODBC driver for Apache Cassandra andDataStax Enterprise with CQL connector that is installed on your Windows machine, youcan find the version number in the ODBC Data Source Administrator.

To verify the version number:1. Click the Start button , then click All Programs, then click the DataStax

Cassandra ODBC Driver 1.0 program group corresponding to the bitness of theclient application accessing data in Cassandra, and then click ODBC Administrator

2. In the ODBC Data Source Administrator, click the Drivers tab and then find theDataStax Cassandra ODBC Driver in the list of ODBC drivers that are installed onyour system. The version number is displayed in the Version column.

Creating a Data Source Name

After installing the DataStax ODBC driver for Apache Cassandra and DataStax Enterprisewith CQL connector, you need to create a Data Source Name (DSN).

To create a Data Source Name:1. Click the Start button , then click All Programs, then click the DataStax

Cassandra ODBC Driver 1.0 program group corresponding to the bitness of theclient application accessing data in Cassandra, and then click ODBC Administrator

2. In the ODBC Data Source Administrator, click the Drivers tab, and then scroll downas needed to confirm that the DataStax Cassandra ODBC Driver appears in thealphabetical list of ODBC drivers that are installed on your system.

3. To create a DSN that only the user currently logged into Windows can use, click theUser DSN tab.

ORTo create a DSN that all users who log into Windows can use, click the System DSNtab.

4. Click Add5. In the Create New Data Source dialog box, select DataStax Cassandra ODBC

Driver and then click Finish6. Use the options in the DataStax Cassandra ODBC Driver DSN Setup dialog box to

configure your DSN:a) In the Data Source Name field, type a name for your DSN.b) Optionally, in the Description field, type relevant details about the DSN.c) In the Host field, type the name or IP address of the host where your

Cassandra instance is running.

www.datastax.com 10

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 11: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

OR

In the Host field, type a comma-separated list of host names or IP addresses ofCassandra servers to which the driver connects.

The driver will attempt to connect to all the servers concurrently, andthen keep the first connection that is successfully established. Thedriver does not maintain a connection with any of the other servers inthe list.

d) In the Port field, type the number of the port that the Cassandra Serverinstance uses.

The default port used by Cassandra is 9042.

e) If user login is required to access the Cassandra instance, then select UserName and Password in the Mechanism list and then type your credentials inthe User name and Password fields.

f) In the Default keyspace field, type the name of the Cassandra keyspace to useby default.

g) To configure advanced driver options, click Advanced Options. For moreinformation, see Configuring Advanced Options on page 11.

h) To configure logging behavior for the driver, click Logging Options. For moreinformation, see Configuring Logging Options on page 14.

7. To test the connection, click Test. Review the results as needed, and then click OK.If the connection fails, then confirm that the settings in the DataStaxCassandra ODBC Driver DSN Setup dialog box are correct. Contact yourCassandra server administrator as needed.

8. To save your settings and close the DataStax Cassandra ODBC Driver DSN Setupdialog box, click OK

9. To close the ODBC Data Source Administrator, click OK

Configuring Advanced Options

You can configure options using the following:l Data Source Namel Database connection string

For information about the configuration options available in the DataStax ODBC driver forApache Cassandra and DataStax Enterprise with CQL connector, see DriverConfiguration Options on page 33.

www.datastax.com 11

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 12: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Using the Data Source Name

To set advanced options using the DataStax Cassandra ODBC Driver DSN Setupdialog box:

1. In the ODBC Data Source Administrator where you created the DSN, select theDSN tab where the Data Source Name appears, and then select the Data SourceName.

2. Click Configure, and then click Advanced Options3. In the Query mode list, select an option to specify how the driver executes queries:

l To execute all queries in SQL, select SQLl To execute all queries in CQL, select CQLl To execute queries in SQL by default and then execute failed queries in CQL,

select SQL with CQL fallback4. In the Tunable consistency list, select an option to specify a Cassandra replica or the

number of Cassandra replicas that must process a query in order for the query to beconsidered successful. For detailed information about each option, see the topicConfiguring data consistency in the Apache Cassandra 2.0 documentation availableat http://www.datastax.com/documentation/cassandra/2.0/cassandra/dml/dml_config_consistency_c.html

5. In the Binary column length field, type the default column length to report for BLOBcolumns.

6. In the String column length field, type the default column length to report for ASCII,TEXT, and VARCHAR columns.

7. In the Virtual table name separator field, type a separator for naming a virtual tablebuilt from a collection.

For information about virtual tables, see Virtual Tables on page 27.

8. To map text and varchar data types in Cassandra to use SQL_WVARCHAR, selectthe Use SQL_WVARCHAR for string data type check box.

9. To configure the driver to split large result sets into pages, select the Enable pagingcheck box and then type the maximum number of rows to display on each page in theRows per page field.

OR

To configure the driver to fetch all results into memory regardless of the result setsize, clear the Enable paging check box.

Disabling paging and then fetching a large result set can cause issues suchas out of memory errors and database timeouts.

10.To configure client-server verification over SSL, use the options in the SSL area. Formore information, see Configuring SSL Verification on page 13.

11.To save your settings and close the Advanced Options dialog box, click OK12.To close the DataStax Cassandra ODBC Driver DSN Setup dialog box, click OK

www.datastax.com 12

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 13: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Using a Database Connection String

The following is an example connection string that sets some advanced options:DSN=DataStax Cassandra ODBC DSN;

Host=server1, server2, server3;

Port=9042;

DefaultKeyspace=MyKeyspace;

StringColumnLength=4000;

BinaryColumnLength=4000;

QueryMode=0;

server 1, server2, and server3 are the host names or IP addresses of the Cassandraservers to which the driver connects. MyKeyspace is the Cassandra keyspace to use.

For more information about the properties that you can use in a connection string, seeDriver Configuration Options on page 33.

Configuring SSL Verification

You can configure verification between the client and the Cassandra server over SSL.

Configuring a Connection without SSL

You can disable SSL verification between the client and the server if it is not needed.

To configure a connection without SSL:1. To access the SSL options for a DSN, open the ODBC Data Source Administrator

where you created the DSN, then select the DSN, then click Configure, and thenclick Advanced Options

2. In the SSL area, select No Verification3. To save your settings and close the dialog box, click OK

Configuring One-way SSL Verification

You can enable the client to verify the Cassandra server.

To configure one-way SSL verification:1. To access the SSL options for a DSN, open the ODBC Data Source Administrator

where you created the DSN, then select the DSN, then click Configure, and thenclick Advanced Options

2. In the SSL area, select One-way Server Verification3. In the Trusted CA Certificates field, specify the full path of the PEM file containing

the certificate for verifying the server.

www.datastax.com 13

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 14: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

4. Optionally, configure the driver to require the host name of the server to match thehost name in the certificate by selecting the Enable Server Hostname Verificationcheck box.

5. To save your settings and close the dialog box, click OK

Configuring Two-way SSL Verification

You can enable the client and the Cassandra server to verify each other.

To configure two-way SSL verification:1. To access the SSL options for a DSN, open the ODBC Data Source Administrator

where you created the DSN, then select the DSN, then click Configure, and thenclick Advanced Options

2. In the SSL area, select Two-way Server and Client Verification3. In the Trusted CA Certificates field, specify the full path of the PEM file containing

the certificate for verifying the server.4. In the Client-side Certificate field, specify the full path of the PEM file containing the

certificate for verifying the client.5. In the Client-side Private Key field, specify the full path of the file containing the

private key used to verify the client.6. If the private key file is protected with a password, type the password in the Key File

Password field. To save the password in the DSN, select the RememberPassword check box.

Passwords are saved in plain text in the DSN; they are not encrypted orcensored.

7. Optionally, configure the driver to require the host name of the server to match thehost name in the certificate by selecting the Enable Server Hostname Verificationcheck box.

8. To save your settings and close the dialog box, click OK

Configuring Logging Options

To help troubleshoot issues, you can enable logging. In addition to functionality provided inthe DataStax ODBC driver for Apache Cassandra and DataStax Enterprise with CQLconnector, the ODBC Data Source Administrator provides tracing functionality.

Only enable logging long enough to capture an issue. Logging decreasesperformance and can consume a large quantity of disk space.

The driver allows you to set the amount of detail included in log files. Table 1 lists thelogging levels provided by the DataStax ODBC driver for Apache Cassandra andDataStax Enterprise with CQL connector, in order from least verbose to most verbose.

www.datastax.com 14

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 15: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Logging Level Description

OFF Disables all logging.

FATAL Logs very severe error events that will lead the driver to abort.

ERROR Logs error events that might still allow the driver to continuerunning.

WARNING Logs potentially harmful situations.

INFO Logs general information that describes the progress of thedriver.

DEBUG Logs detailed information that is useful for debugging the driver.

TRACE Logs more detailed information than the DEBUG level.

Table 1. DataStax ODBC driver for Apache Cassandra and DataStax Enterprise with CQLconnector Logging Levels

To enable the logging functionality available in the DataStax ODBC driver forApache Cassandra and DataStax Enterprise with CQL connector:

1. In the DataStax Cassandra ODBC Driver DSN Setup dialog box, click LoggingOptions

2. In the Log Level list, select the desired level of information to include in log files.3. In the Log Path field, type the full path to the folder where you want to save log files.4. If requested by Technical Support, type the name of the component for which to log

messages in the Log Namespace field. Otherwise, do not type a value in the field.5. Click OK

The DataStax ODBC driver for Apache Cassandra and DataStax Enterprise with CQLconnector produces a log file named DataStax Cassandra ODBC Driver_driver.log at thelocation you specify using the Log Path field.

To disable DataStax ODBC driver for Apache Cassandra and DataStax Enterprisewith CQL connector logging:

1. In the DataStax Cassandra ODBC Driver DSN Setup dialog box, click LoggingOptions

2. In the Log Level list, select LOG_OFF3. Click OK

To start tracing using the ODBC Data Source Administrator:1. In the ODBC Data Source Administrator, click the Tracing tab.

www.datastax.com 15

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 16: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

2. In the Log File Path area, click Browse. In the Select ODBC Log File dialog box,browse to the location where you want to save the log file, then type a descriptive filename in the File name field, and then click Save

3. On the Tracing tab, click Start Tracing Now

To stop ODBC Data Source Administrator tracing:On the Tracing tab in the ODBC Data Source Administrator, click Stop TracingNow

For more information about tracing using the ODBC Data Source Administrator, see thearticle How to Generate an ODBC Trace with ODBC Data Source Administrator athttp://support.microsoft.com/kb/274551

www.datastax.com 16

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 17: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Linux Driver

System Requirements

You install the DataStax ODBC driver for Apache Cassandra and DataStax Enterprisewith CQL connector on client computers accessing data in Cassandra databases. Eachcomputer where you install the driver must meet the following minimum systemrequirements:

l One of the following distributions (32- and 64-bit editions are supported):o Red Hat® Enterprise Linux® (RHEL) 5.x or 6.xo CentOS 5.x or 6.xo SUSE Linux Enterprise Server (SLES) 11

l 45 MB of available disk spacel One of the following ODBC driver managers installed:

o iODBC 3.52.7 or latero unixODBC 2.2.12 or later

DataStax ODBC driver for Apache Cassandra and DataStax Enterprise with CQLconnector version 1.0.0 supports Apache Cassandra 2.0 and later.

Installing the Driver

There are two versions of the driver for Linux:l DataStaxCassandraODBC-32bit-Version.rpm for the 32-bit driverl DataStaxCassandraODBC-Version.rpm for the 64-bit driver

Version is the version number of the driver, and Release is the release number for thisversion of the driver.

The bitness of the driver that you select should match the bitness of the client applicationaccessing your Cassandra data. For example, if the client application is 64-bit, then youshould install the 64-bit driver. Note that 64-bit editions of Linux support both 32- and 64-bit applications. Verify the bitness of your intended application and install the appropriateversion of the driver.

The DataStax ODBC driver for Apache Cassandra and DataStax Enterprise with CQLconnector driver files are installed in the following directories:

l /opt/datastax/cassandraodbc/ErrorMessages contains error message filesrequired by the driver.

l /opt/datastax/cassandraodbc/Setup contains sample configuration files namedodbc.ini and odbcinst.ini

www.datastax.com 17

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 18: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

l /opt/datastax/cassandraodbc/lib/32 contains the 32-bit shared libraries and thedatastax.cassandraodbc.ini configuration file.

l /opt/datastax/cassandraodbc/lib/64 contains the 64-bit shared libraries and thedatastax.cassandraodbc.ini configuration file.

To install the DataStax ODBC driver for Apache Cassandra and DataStaxEnterprise with CQL connector:

1. In Red Hat Enterprise Linux or CentOS, log in as the root user, then navigate to thefolder containing the driver RPM packages to install, and then type the following atthe command line, where RPMFileName is the file name of the RPM packagecontaining the version of the driver that you want to install:yum --nogpgcheck localinstall RPMFileName

ORIn SUSE Linux Enterprise Server, log in as the root user, then navigate to the foldercontaining the driver RPM packages to install, and then type the following at thecommand line, where RPMFileName is the file name of the RPM package containingthe version of the driver that you want to install:zypper install RPMFileName

Verifying the Version Number

If you need to verify the version of the DataStax ODBC driver for Apache Cassandra andDataStax Enterprise with CQL connector that is installed on your Linux machine, you canquery the version number through the command-line interface.

To verify the version number:At the command prompt, run the following command:yum list | grep DataStaxCassandraODBC

ORRun the following command:rpm -qa | grep DataStaxCassandraODBC

The command returns information about the DataStax ODBC driver for ApacheCassandra and DataStax Enterprise with CQL connector that is installed on your machine,including the version number.

Setting the LD_LIBRARY_PATH Environment Variable

The LD_LIBRARY_PATH environment variable must include the path to the installedODBC driver manager libraries.

For example, if ODBC driver manager libraries are installed in /usr/local/lib, then set LD_LIBRARY_PATH as follows:export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

www.datastax.com 18

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 19: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

For information about how to set environment variables permanently, refer to your Linuxshell documentation.

For information about creating ODBC connections using the DataStax ODBC driver forApache Cassandra and DataStax Enterprise with CQL connector, see ConfiguringODBC Connections for Non-Windows Platforms on page 19.

Configuring ODBC Connections for Non-Windows Platforms

The following sections describe how to configure ODBC connection when using theDataStax ODBC driver for Apache Cassandra and DataStax Enterprise with CQLconnector with non-Windows platforms:

l Files on page 19l Sample Files on page 20l Configuring the Environment on page 20l Configuring the odbc.ini File on page 21l Configuring the odbcinst.ini File on page 22l Configuring the datastax.cassandraodbc.ini File on page 23l Configuring SSL Verification on page 23l Configuring Logging Options on page 24

Files

ODBC driver managers use configuration files to define and configure ODBC data sourcesand drivers. By default, the following configuration files residing in the user’s homedirectory are used:

l .odbc.ini is used to define ODBC data sources, and it is required.l .odbcinst.ini is used to define ODBC drivers, and it is optional.

Also, by default the DataStax ODBC driver for Apache Cassandra and DataStaxEnterprise with CQL connector is configured using the datastax.cassandraodbc.ini file,which is located in one of the following directories depending on the version of the driverthat you are using:

l /opt/datastax/cassandraodbc/lib/32 for the 32-bit driver on Linuxl /opt/datastax/cassandraodbc/lib/64 for the 64-bit driver on Linux

The datastax.cassandraodbc.ini file is required.

The datastax.cassandraodbc.ini file in the /lib subfolder provides default settingsfor most configuration options available in the DataStax ODBC driver for ApacheCassandra and DataStax Enterprise with CQL connector.

You can set driver configuration options in your odbc.ini and datastax.cassandraodbc.inifiles. Configuration options set in a datastax.cassandraodbc.ini file apply to allconnections, whereas configuration options set in an odbc.ini file are specific to a

www.datastax.com 19

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 20: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

connection. Configuration options set in odbc.ini take precedence over configurationoptions set in datastax.cassandraodbc.ini. For information about the configuration optionsavailable for controlling the behavior of DSNs that are using the DataStax ODBC driver forApache Cassandra and DataStax Enterprise with CQL connector, see DriverConfiguration Options on page 33

Sample Files

The driver installation contains the following sample configuration files in the Setupdirectory:

l odbc.inil odbcinst.ini

These sample configuration files provide preset values for settings related to the DataStaxODBC driver for Apache Cassandra and DataStax Enterprise with CQL connector.

The names of the sample configuration files do not begin with a period (.) so that they willappear in directory listings by default. A filename beginning with a period (.) is hidden. Forodbc.ini and odbcinst.ini, if the default location is used, then the filenames must begin witha period (.).

If the configuration files do not exist in the home directory, then you can copy the sampleconfiguration files to the home directory, and then rename the files. If the configurationfiles already exist in the home directory, then use the sample configuration files as a guideto modify the existing configuration files.

Configuring the Environment

Optionally, you can use three environment variables—ODBCINI, ODBCSYSINI, andDATASTAXCASSANDRAODBC—to specify different locations for the odbc.ini,odbcinst.ini, and datastax.cassandraodbc.ini configuration files by doing the following:

l Set ODBCINI to point to your odbc.ini file.l Set ODBCSYSINI to point to the directory containing the odbcinst.ini file.l Set DATASTAXCASSANDRAODBC to point to your datastax.cassandraodbc.ini

file.

For example, if your odbc.ini and datastax.cassandraodbc.ini files are located in /etc andyour odbcinst.ini file is located in /usr/local/odbc, then set the environment variables asfollows:export ODBCINI=/etc/odbc.ini

export ODBCSYSINI=/usr/local/odbc

export DATASTAXCASSANDRAODBC=/etc/datastax.cassandraodbc.ini

The following search order is used to locate the datastax.cassandraodbc.ini file:1. If the DATASTAXCASSANDRAODBC environment variable is defined, then the

driver searches for the file specified by the environment variable.

www.datastax.com 20

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 21: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

DATASTAXCASSANDRAODBC must specify the full path, including thefile name.

2. The directory containing the driver’s binary is searched for a file nameddatastax.cassandraodbc.ini not beginning with a period.

3. The current working directory of the application is searched for a file nameddatastax.cassandraodbc.ini not beginning with a period.

4. The directory ~/ (that is, $HOME) is searched for a hidden file named.datastax.cassandraodbc.ini

5. The directory /etc is searched for a file named datastax.cassandraodbc.ini notbeginning with a period.

Configuring the odbc.ini File

ODBC Data Source Names (DSNs) are defined in the odbc.ini configuration file. The file isdivided into several sections:

l [ODBC] is optional and used to control global ODBC configuration, such as ODBCtracing.

l [ODBC Data Sources] is required, listing DSNs and associating DSNs with adriver.

l A section having the same name as the data source specified in the [ODBC DataSources] section is required to configure the data source.

The following is an example of an odbc.ini configuration file:[ODBC Data Sources]

DataStax Cassandra ODBC DSN 32=DataStax Cassandra ODBCDriver 32-bit

[DataStax Cassandra ODBC DSN 32]

Driver=/opt/datastax/cassandraodbc/lib/32/libdatastaxcqlodbc32.so

HOST=server1, server2, server3

PORT=9042

QueryMode=0

DefaultKeyspace=MyKeyspace

server1, server2, and server3 are the host names or IP addresses of the Cassandraservers to which the driver connects. MyKeyspace is the Cassandra keyspace to use.

To create a Data Source Name:1. Open the .odbc.ini configuration file in a text editor.2. In the [ODBC Data Sources] section, add a new entry by typing the Data Source

Name (DSN), then an equal sign (=), and then the driver name.

www.datastax.com 21

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 22: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

3. In the .odbc.ini file, add a new section with a name that matches the DSN youspecified in step 2, and then add configuration options to the section. Specifyconfiguration options as key-value pairs.

4. Save the .odbc.ini configuration file.

For information about the configuration options available for controlling the behavior ofDSNs that are using the DataStax ODBC driver for Apache Cassandra and DataStaxEnterprise with CQL connector, see Driver Configuration Options on page 33.

Configuring the odbcinst.ini File

ODBC drivers are defined in the odbcinst.ini configuration file. The configuration file isoptional because drivers can be specified directly in the odbc.ini configuration file, asdescribed in Configuring the odbc.ini File on page 21.

The odbcinst.ini file is divided into the following sections:l [ODBC Drivers] lists the names of all the installed ODBC drivers.l A section having the same name as the driver name specified in the [ODBC Drivers]

section lists driver attributes and values.

The following is an example of an odbcinst.ini configuration file:[ODBC Drivers]

DataStax Cassandra ODBC Driver 32-bit=Installed

DataStax Cassandra ODBC Driver 64-bit=Installed

[DataStax Cassandra ODBC Driver 32-bit]

Description=DataStax Cassandra ODBC Driver (32-bit)

Driver=/opt/datastax/cassandraodbc/lib/32/libdatastaxcqlodbc32.so

[DataStax Cassandra ODBC Driver 64-bit]

Description=DataStax Cassandra ODBC Driver (64-bit)

Driver=/opt/datastax/cassandraodbc/lib/64/libdatastaxcqlodbc64.so

To define a driver:1. Open the .odbcinst.ini configuration file in a text editor.2. In the [ODBC Drivers] section, add a new entry by typing the driver name and then

typing =InstalledType a symbolic name that you want to use to refer to the driver inconnection strings or DSNs.

3. In the .odbcinst.ini file, add a new section with a name that matches the driver nameyou typed in step 2, and then add configuration options to the section based on thesample odbcinst.ini file provided in the Setup directory. Specify configuration optionsas key-value pairs.

www.datastax.com 22

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 23: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

4. Save the .odbcinst.ini configuration file.

Configuring the datastax.cassandraodbc.ini File

The datastax.cassandraodbc.ini file contains configuration settings for the DataStaxODBC driver for Apache Cassandra and DataStax Enterprise with CQL connector.Settings that you define in the datastax.cassandraodbc.ini file apply to all connections thatuse the driver.

To configure the DataStax ODBC driver for Apache Cassandra and DataStaxEnterprise with CQL connector to work with your ODBC driver manager:

1. Open the datastax.cassandraodbc.ini configuration file in a text editor.2. Edit the DriverManagerEncoding setting. The value is usually UTF-16 or UTF-32,

depending on the ODBC driver manager you use. iODBC uses UTF-32, andunixODBC uses UTF-16. To determine the correct setting to use, refer to yourODBC Driver Manager documentation.

3. Edit the ODBCInstLib setting. The value is the name of the ODBCInst shared libraryfor the ODBC driver manager you use. To determine the correct library to specify,refer to your ODBC driver manager documentation.The configuration file defaults to the shared library for iODBC. In Linux, the sharedlibrary name for iODBC is libiodbcinst.so.

You can specify an absolute or relative filename for the library. If you intendto use the relative filename, then the path to the library must be included inthe library path environment variable. In Linux, the library path environmentvariable is named LD_LIBRARY_PATH.

4. Optionally, configure logging by editing the LogLevel and LogPath settings. For moreinformation, see Configuring Logging Options on page 24.

5. Save the datastax.cassandraodbc.ini configuration file.

Configuring SSL Verification

You can configure verification between the client and the Cassandra server over SSL bydefining the SSLMode connection attribute in a connection string or in a DSN (in theodbc.ini file). Depending on the type of SSL verification that you use, there may beadditional connection attributes that you must define. For more information about theattributes involved in configuring SSL verification, see Driver Configuration Options onpage 33.

Configuring a Connection without SSL

You can disable SSL verification between the client and the server if it is not needed.

To configure a connection without SSL:Set the SSLMode connection attribute to 0

www.datastax.com 23

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 24: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Configuring One-way SSL Verification

You can enable the client to verify the Cassandra server.

To configure one-way SSL verification:1. Set the SSLMode connection attribute to 12. Set the SSLTrustedCertsPath connection attribute to the full path of the PEM file

containing the certificate for verifying the server.3. Optionally, configure the driver to require the host name of the server to match the

host name in the certificate by setting the UseSslIdentityCheck connection attributeto 1

Configuring Two-way SSL Verification

You can enable the client and the Cassandra server to verify each other.

To configure two-way SSL verification:1. Set the SSLMode connection attribute to 22. Set the SSLTrustedCertsPath connection attribute to the full path of the PEM file

containing the certificate for verifying the server.3. Set the SSLUserCertsPath connection attribute to the full path of the PEM file

containing the certificate for verifying the client.4. Set the SSLUserKeyPath connection attribute to the full path of the file containing

the private key used to verify the client.5. If the private key file is protected with a password, set the SSLUserKeyPWD

connection attribute to specify the password.Passwords are saved in plain text in the DSN; they are not encrypted orcensored.

6. Optionally, configure the driver to require the host name of the server to match thehost name in the certificate by setting the UseSslIdentityCheck connection attributeto 1

Configuring Logging Options

To help troubleshoot issues, you can enable logging in the driver.

Only enable logging long enough to capture an issue. Logging decreasesperformance and can consume a large quantity of disk space.

Use the LogLevel key to set the amount of detail included in log files. Table 2 lists thelogging levels provided by the DataStax ODBC driver for Apache Cassandra andDataStax Enterprise with CQL connector, in order from least verbose to most verbose.

www.datastax.com 24

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 25: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

LogLevel Value Description

0 Disables all logging.

1 Logs very severe error events that will lead the driver to abort.

2 Logs error events that might still allow the driver to continuerunning.

3 Logs potentially harmful situations.

4 Logs general information that describes the progress of thedriver.

5 Logs detailed information that is useful for debugging the driver.

6 Logs more detailed information than LogLevel=5

Table 2. DataStax ODBC driver for Apache Cassandra and DataStax Enterprise with CQLconnector Logging Levels

To enable logging:1. Open the datastax.cassandraodbc.ini configuration file in a text editor.2. Set the LogLevel key to the desired level of information to include in log files. For

example:LogLevel=2

3. Set the LogPath key to the full path to the folder where you want to save log files. Forexample:LogPath=/localhome/employee/Documents

4. Save the datastax.cassandraodbc.ini configuration file.

The DataStax ODBC driver for Apache Cassandra and DataStax Enterprise with CQLconnector produces a log file named DataStax Cassandra ODBC Driver_driver.log at thelocation you specify using the LogPath key.

To disable logging:1. Open the datastax.cassandraodbc.ini configuration file in a text editor.2. Set the LogLevel key to 03. Save the datastax.cassandraodbc.ini configuration file.

www.datastax.com 25

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 26: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Features

More information is provided on the following features of the DataStax ODBC driver forApache Cassandra and DataStax Enterprise with CQL connector:

l CQL Connector on page 26l Data Types on page 26l Virtual Tables on page 27l Write-Back on page 29l TRUNCATE TABLE on page 29l Query Modes on page 30l Authentication on page 30l Catalog and Schema Support on page 30

CQL Connector

The CQL Connector feature of the driver allows applications to use normal SQL queriesagainst Cassandra, translating standard SQL-92 queries into equivalent CQL client APIcalls. This allows standard queries that BI tools execute to run against your Cassandrainstance.

Data Types

The DataStax ODBC driver for Apache Cassandra and DataStax Enterprise with CQLconnector supports the following data types:

l AsciiTypel BigintTypel BlobTypel BooleanTypel CounterTypel DecimalTypel DoubleType

l FloatTypel InetTypel IntTypel ListTypel MapTypel SetTypel TextType

l TimestampTypel UuidTypel TimeuuidTypel VarcharTypel VarintType

Cassandra internally represents Timestamp value as a 64-bit signed integer valuerepresenting the number of milliseconds since epoch "January 1 1970 at 00:00:00GMT". The range of Timestamp values supported by the DataStax ODBC driverfor Apache Cassandra and DataStax Enterprise with CQL connector is from"1601-01-01 00:00:00.000" to "9999-12-31 23:59:59.999".

www.datastax.com 26

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 27: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

To support complex data types such as sets, lists, and maps, the driver converts the datainto virtual tables. For more information, see Virtual Tables on page 27.

Virtual Tables

One advantage of the Apache Cassandra design is the ability to store data that isdenormalized into a fewer number of tables. By taking advantage of nested data structuressuch as sets, lists, and maps, transactions can be simplified. However, the ODBCinterface does not natively support accessing this type of data. By expanding the datacontained within collections (sets, lists, and maps) into virtual tables, the DataStax ODBCdriver for Apache Cassandra and DataStax Enterprise with CQL connector allows users todirectly interact with the data but leave the storage of the data in its denormalized form inCassandra.

If a table contains any collection columns, when the table is queried for the first time, thedriver creates the following virtual tables and saves them as part of the schema definition:

l A "main" virtual table, which contains the same data as the real table except for thecollection columns.

l A virtual table for each collection column, expanding the first level of nested data.

Virtual tables refer to the data in the real table, enabling the driver to access thedenormalized data. By querying the virtual tables, you can access the contents ofCassandra collections via ODBC. When you write or modify data in a virtual table, the datain the real table in the Cassandra database is updated.

Virtual tables appear as additional tables in the list of tables that exist in the database. Themain virtual table uses the same name as the real table that it represents. The virtualtables that represent collections are named using the name of the real table, a separator (_vt_), and the name of the column.

For example, consider the table in Cassandra called ExampleTable shown in Table 3.ExampleTable contains an integer primary key column named pk_int, a list column, a mapcolumn, and a set column (named StringSet).

pk_int List Map StringSet

1 ["1", "2" , "3"] { "S1" : "a", "S2" : "b" } { "A", "B", "C" }

3 ["100", "101", "102","105"]

{ "S1" : "t" } { "A", "E" }

Table 3. ExampleTable

The driver would generate multiple virtual tables to represent this single table. The firstvirtual table is the main virtual table, shown in Table 4.

www.datastax.com 27

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 28: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

pk_int

1

3

Table 4. ExampleTable

The main virtual table contains all of the data of the original table, but the data from thecollections have been omitted and will be expanded in the other virtual tables.

Table 5, Table 6, and Table 7 show the expanded virtual tables representing the data fromthe List, Map, and StringSet columns.

pk_int List#index List#value

1 0 1

1 1 2

1 2 3

3 0 100

3 1 101

3 2 102

3 3 105

Table 5. ExampleTable_vt_List

pk_int Map#key Map#value

1 S1 a

1 S2 b

3 S1 t

Table 6. ExampleTable_vt_Map

www.datastax.com 28

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 29: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

pk_int StringSet#value

1 A

1 B

1 C

3 A

3 E

Table 7. ExampleTable_vt_StringSet

The foreign key columns in the virtual tables reference the primary key columns in the realtable, and indicate which real table row the virtual table row corresponds to. The columnswith names that end with #index or #key indicate the position of the data within the originallist, map, or set. The columns with names that end with #value contain the expanded datafrom the collection.

The data in the virtual tables can be selected, inserted, and updated as if they were normaltables, and the driver will handle the storage details within Cassandra. You can alsoexplicitly append data to the end of a list by inserting a row of data with the index columnset to -1.

For example, to append 106 to the List column in ExampleTable, where pk_int = 3, use thefollowing query:INSERT INTO “ExampleTable_vt_List” (pk_int, “List#index”,“List#value”) VALUES (3, -1, ‘106’)

Write-Back

The DataStax ODBC driver for Apache Cassandra and DataStax Enterprise with CQLconnector supports Data Manipulation Languages (DML) statements such as INSERT,UPDATE, and DELETE.

Because Cassandra only provides the UPSERT operation instead of INSERT andUPDATE, when you execute an INSERT or UPDATE statement using theDataStax ODBC driver for Apache Cassandra and DataStax Enterprise with CQLconnector, it will behave like an UPSERT operation. This means that bothINSERT and UPDATE will set the column value regardless of whether the dataalready exists.

TRUNCATE TABLE

The TRUNCATE TABLE tableName syntax is neither standard SQL-92 nor CQL. TheDataStax ODBC driver for Apache Cassandra and DataStax Enterprise with CQL

www.datastax.com 29

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 30: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

connector translates the TRUNCATE TABLE tableName syntax into TRUNCATEtableName CQL syntax for non-virtual tables. Use DELETE FROM virtualTableName todelete all the rows from a virtual table.

Query Modes

SQL

In this query mode, the driver will treat all incoming queries as SQL and will not accept anyCQL query syntax that is not standard SQL-92 syntax.

CQL

In this query mode, the driver will treat all incoming queries as CQL and will not accept anynon-CQL syntax.

SQL with CQL fallback

SQL with CQL fallback is the default query mode used by the driver. In this query mode,the driver will attempt to treat the incoming query as SQL first. If an error occurs whilehandling the query as SQL, then the driver will pass the original query to Cassandra toexecute as CQL.

The SQL with CQL fallback query mode will not work if the incoming queryreferences virtual tables, as Cassandra is not aware of virtual tables. Whenquerying against virtual tables, ensure that the query syntax is valid SQL-92syntax.

Authentication

The Cassandra service supports authentication through user login. Configureauthentication for your connection by enabling the authentication mechanism and thenspecifying a user name and password in the DSN or in the connection string. You can alsouse the features available in your client application to implement access control.

Catalog and Schema Support

The DataStax ODBC driver for Apache Cassandra and DataStax Enterprise with CQLconnector supports both catalogs and schemas in order to make it easy for the driver towork with various ODBC applications. Since Cassandra only organizes column familiesinto keyspaces, the DataStax ODBC driver for Apache Cassandra and DataStaxEnterprise with CQL connector adds a synthetic catalog called “CASSANDRA” underwhich all keyspaces are organized.

www.datastax.com 30

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 31: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Known Issues

The following are known issues that you might encounter while using the driver.

Qualified Column Name in INSERT/UPDATE Statements

The following query format is currently not supported by the DataStax ODBC driver forApache Cassandra and DataStax Enterprise with CQL connector because this formatuses non-standard SQL-92 syntax:INSERT INTO TABLE tableName(schemaName.tableName.columnName, ...) VALUES (...)

Non-key Virtual Table Columns are not Nullable

Cassandra does not support null values in collections. The DataStax ODBC driver forApache Cassandra and DataStax Enterprise with CQL connector reports non-key columnsin virtual tables as not nullable.

www.datastax.com 31

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 32: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Contact Us

If you have difficulty using the driver, please contact our Support staff.

For information about contacting Support, go to http://www.datastax.com/what-we-offer/products-services/support

www.datastax.com 32

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 33: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Appendix A Driver Configuration Options

Appendix A Driver Configuration Options on page 33 lists the configuration optionsavailable in the DataStax ODBC driver for Apache Cassandra and DataStax Enterprisewith CQL connector alphabetically by field or button label.

When creating or configuring a connection from a Windows computer, the fields andbuttons are available in the following dialog boxes:

l DataStax Cassandra ODBC Driver DSN Setupl Advanced Options

When using a connection string or configuring a connection from a Linux computer, use thekey names provided.

You can pass in configuration options in your connection string or set them in yourodbc.ini and datastax.cassandraodbc.ini files. Configuration options set in adatastax.cassandraodbc.ini file apply to all connections, whereas configurationoptions passed in in the connection string or set in an odbc.ini file are specific to aconnection. Configuration options passed in using the connection string takeprecedence over configuration options set in odbc.ini. Configuration options set inodbc.ini take precedence over configuration options set indatastax.cassandraodbc.ini

The following configuration options are available:

l Binary Column Length on page 33l Client-side Certificate on page 34l Client-side Private Key on page 34l Default Keyspace on page 34l Enable Paging on page 34l Enable Server Hostname Veri-

fication on page 35l Host on page 35l Key File Password on page 35l SSL on page 37l Mechanism on page 36

l Password on page 36l Port on page 36l Query Mode on page 37l Rows Per Page on page 37l String Column Length on page 38l Trusted CA Certificates on page 38l Tunable Consistency on page 38l Use SQL_WVARCHAR for String

Data Types on page 39l User Name on page 39l Virtual Table Name Separator on

page 40

Binary Column Length

Key Name Default Value Required

BinaryColumnLength 4000 No

www.datastax.com 33

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 34: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Description

The default column length to report for BLOB columns.

Client-side Certificate

Key Name Default Value Required

SSLUserCertsPath None Yes, if two-waySSL verification isenabled.

Description

The full path of the PEM file containing the certificate for verifying the client.

Client-side Private Key

Key Name Default Value Required

SSLUserKeyPath None Yes, if two-waySSL verification isenabled.

Description

The full path of the file containing the private key used to verify the client.

Default Keyspace

Key Name Default Value Required

DefaultKeyspace None No

Description

The default keyspace (schema) to connect to in Cassandra.

Enable Paging

Key Name Default Value Required

EnablePaging Selected (1) No

www.datastax.com 34

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 35: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Description

When this option is enabled (1), the driver splits large result sets into pages.

When this option is disabled (0), the driver fetches all results into memory regardless of theresult set size.

See also the driver configuration option Rows Per Page on page 37.

Enable Server Hostname Verification

Key Name Default Value Required

UseSslIdentityCheck Selected (1) No

Description

When this option is enabled (1), during SSL verification the driver requires the host nameof the server to match the host name in the certificate.

When this option is disabled (0), during SSL verification the driver allows the host name ofthe server to not match the host name in the certificate.

Host

Key Name Default Value Required

Host None Yes

Description

The IP address or host name of the Cassandra server.

You can specify a comma-separated list of IP addresses or host names. The driver willattempt to connect to all the servers concurrently, and then keep the first connection that issuccessfully established. The driver does not maintain a connection with any of the otherservers in the list.

Key File Password

Key Name Default Value Required

SSLUserKeyPWD None No

www.datastax.com 35

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 36: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Description

The password of the private key file that is specified in the Client-side Private Key field (theSSLUserKeyPath key).

Mechanism

Key Name Default Value Required

AuthMech No Authentication (0) No

Description

The authentication mechanism to use.

Select one of the following settings, or set the key to the corresponding number:l No Authentication (0)l User Name and Password (1)

Password

Key Name Default Value Required

PWD None Yes, if the authenticationmechanism is User Nameand Password.

Description

The password corresponding to the user name that you provided in the User Name field(the UID key).

Port

Key Name Default Value Required

Port 9042 Yes

Description

The number of the port that the Cassandra server uses.

www.datastax.com 36

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 37: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Query Mode

Key Name Default Value Required

QueryMode SQL with CQL fallback (2) No

Description

The query mode to use when sending queries to Cassandra.

When this option is set to SQL (0), the driver uses SQL_QUERY_MODE and executes allqueries in SQL.

When this option is set to CQL (1), the driver uses CQL_QUERY_MODE and executes allqueries in CQL.

When this option is set to SQL with CQL fallback (2), the driver uses SQL_WITH_CQL_FALLBACK_QUERY_MODE and executes all queries in SQL by default. If a query fails,then the driver executes the query in CQL.

Rows Per Page

Key Name Default Value Required

RowsPerPage 10000 No

Description

When result set paging is enabled, use this option to specify the maximum number of rowsto display on each page.

See also the driver configuration option Enable Paging on page 34.

SSL

Key Name Default Value Required

SSLMode No verification (0) No

Description

When this option is set to No verification (0), client-server verification over SSL is disabled.

When this option is set to One-way Server Verification (1), the client verifies theCassandra server using SSL.

www.datastax.com 37

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 38: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

When this option is set to Two-way Server and Client Verification (2), the client and theCassandra server verify each other using SSL.

String Column Length

Key Name Default Value Required

StringColumnLength 4000 No

Description

The default column length to report for ASCII, TEXT, and VARCHAR columns.

Trusted CA Certificates

Key Name Default Value Required

SSLTrustedCertsPath The cacerts.pem file in thelib folder or subfolderwithin the driver'sinstallation directory.

The exact file path variesdepending on the versionof the driver that isinstalled. For example, thepath for the Windowsdriver is different from thepath for the Linux driver.

Yes, if SSL verification isenabled.

Description

The full path of the PEM file containing the certificate for verifying the server.

Tunable Consistency

Key Name Default Value Required

TunableConsistency ONE (1) No

Description

The specific Cassandra replica or the number of Cassandra replicas that must process aquery in order for the query to be considered successful.

www.datastax.com 38

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 39: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Select one of the following settings, or set the key to the corresponding number:l ANY (0)l ONE (1)l TWO (2)l THREE (3)l QUORUM (4)l ALL (5)l LOCAL_QUORUM (6)l EACH_QUORUM (7)l LOCAL_ONE (10)

Each setting corresponds to one of the consistency levels available in Cassandra. Fordetailed information about each consistency level, see Configuring data consistency in theApache Cassandra 2.0 documentation:http://www.datastax.com/documentation/cassandra/2.0/cassandra/dml/dml_config_consistency_c.html

Use SQL_WVARCHAR for String Data Types

Key Name Default Value Required

UseSqlWVarchar Clear (0) No

Description

When this option is enabled (1), the Cassandra data types text and varchar are mapped toSQL_VARCHAR.

When this option is disabled (0), the Cassandra data types text and varchar are mapped toSQL_WVARCHAR.

User Name

Key Name Default Value Required

UID None Yes, if the authenticationmechanism is User Nameand Password.

Description

The user name that you use to access the Cassandra server.

www.datastax.com 39

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide

Page 40: DataStaxODBCdriverforApache CassandraandDataStaxEnterprise … · 2015-08-26 · Introduction TheDataStaxODBCdriverforApacheCassandraandDataStaxEnterprisewithCQL connectorenablesBusinessIntelligence(BI),analytics,andreportingondatathatis

Virtual Table Name Separator

Key Name Default Value Required

VTTableNameSeparator _vt_ No

Description

The separator for naming a virtual table built from a collection.

The name of a virtual table consists of the name of the original table, then the separator,and then the name of the collection.

For example, OriginalTable_vt_CollectionName

www.datastax.com 40

DataStax ODBC driver for Apache Cas-sandra and DataStax Enterprise withCQL connector

Install Guide