Download - Simba Apache Cassandra ODBC Driver Quickstart Guide€¦ · Simba Apache Cassandra ODBC Driver . Quickstart Guide . Purpose . This document is targeted towards users of the Simba

Transcript

Simba Apache Cassandra ODBC Driver Quickstart Guide

Revised: October 29, 2013

Page | 2

Simba Apache Cassandra ODBC Driver Quickstart Guide

Contents Purpose ......................................................................................................................................................... 3

Do you need Cassandra? ............................................................................................................................... 4

Do you need sample data in Cassandra? ...................................................................................................... 7

Install the Simba Apache Cassandra ODBC Driver ...................................................................................... 14

Connect from Excel ..................................................................................................................................... 19

Connect from Tableau ................................................................................................................................ 24

Troubleshooting .......................................................................................................................................... 31

Architecture Mismatch Problems ........................................................................................................... 31

For assistance at any point in this installation process, please contact Simba for free Engineering Level Support at: [email protected].

Page | 3

Simba Apache Cassandra ODBC Driver Quickstart Guide

Purpose This document is targeted towards users of the Simba Apache Cassandra ODBC Driver. The following sections will outline how to get your Windows environment quickly set up to allow for evaluation and use of the driver.

Use the following flow-chart to determine what page of the guide to start on.

Page | 4

Simba Apache Cassandra ODBC Driver Quickstart Guide

Do you need Cassandra? How to Download Cassandra for free:

a. Visit https://cassandra.apache.org/download/ and download the 1.2 branch. Note: The ODBC driver currently only supports Cassandra 1.2; 2.0 support coming soon.

b. Install guides at: https://wiki.apache.org/cassandra/GettingStarted

Confirm Cassandra is installed and running:

STEP 1: Navigate to the /bin directory of the Cassandra installation.

Page | 5

Simba Apache Cassandra ODBC Driver Quickstart Guide

STEP 2:

Start Cassandra by using the following command: cassandra –f

This should print out a lot of diagnostic information to the console, however at the end it should say “Listening for thrift clients…”

Page | 6

Simba Apache Cassandra ODBC Driver Quickstart Guide

STEP 3:

Verify that connectivity is working by starting a separate shell and navigating to the /bin directory of the Cassandra installation. Start the Cassandra shell by executing the following command:

cqlsh -2

You should see something similar to the following if Cassandra is running correctly.

Page | 7

Simba Apache Cassandra ODBC Driver Quickstart Guide

Do you need sample data in Cassandra? How to get a sample data set for Cassandra?

Step 1: Download the sample data set from: http://www.simba.com/wp-content/uploads/2013/10/FAA_Cassandra.zip Note: This is a modified version of the FAA data set, the original which is available here: http://www.transtats.bts.gov/DL_SelectFields.asp?Table_ID=236&DB_Short_Name=On-Time

Step 2: Extract the zip file that was downloaded.

Page | 8

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 3: Ensure Cassandra is running, as per the directions in the previous section. Step 4: Navigate to the Cassandra /bin directory, and start cqlsh with the following command:

cqlsh -2

You should see cqlsh connect to your local Cassandra instance.

Note that running with the “-2” option to use CQL 2 is important, as the driver will not recognize keyspaces and column families that are defined with CQL 3.

Page | 9

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 5: Create the keyspace for the new column family with the following command:

create keyspace faa with strategy_class = ‘SimpleStrategy’ and strategy_options:replication_factor = ‘1’;

Page | 10

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 6: Switch to the newly created keyspace with the following command:

use faa;

Page | 11

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 7: Create the column family for your data using the following command:

CREATE COLUMNFAMILY airline (key int PRIMARY KEY, UNIQUE_CARRIER varchar, AIRLINE_ID varchar, CARRIER varchar, TAIL_NUM varchar, FL_NUM varchar);

Step 7: Exit cqlsh by typing:

exit

Then restart cqlsh using the following command:

cqlsh -3

This is required as the COPY FROM command that is used to easily import data requires CQL3 in the latest versions of Cassandra 1.2.

Page | 12

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 8: Copy the Airline.csv file that was extracted from the zip file to your Cassandra /bin directory. Run the following command to import the data from the CSV to the column family:

Page | 13

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 9: Verify that the data has been imported correctly by running the following command:

select * from faa.airline;

Page | 14

Simba Apache Cassandra ODBC Driver Quickstart Guide

Install the Simba Apache Cassandra ODBC Driver How to Get the Simba Apache Cassandra Driver?

Step 1: Download from: http://www.simba.com/connectors/apache-cassandra-odbc

Choose either the 32 or 64 bit version as appropriate. Follow the steps in the install guide (http://www.simba.com/wp-content/uploads/2013/07/Simba-ODBC-Driver-for-Cassandra-Install-Guide.pdf) to install on your machine.

Note that the Simba Apache Cassandra ODBC Driver currently only supports Cassandra 1.2. Cassandra 2.0 support is coming soon.

Step 2: You should receive an email with a license key attached. This license key should be placed alongside the driver DLL in the installation directory. By default, the directories for the licenses are:

• C:\Program Files\Simba Cassandra ODBC Driver\lib • 32-bit driver on 64-bit Windows: C:\Program Files (x86)\Simba Cassandra ODBC Driver\lib

Note that if you use Outlook, you may need to save the license file locally before placing it in the above directory to avoid permission problems.

Page | 15

Simba Apache Cassandra ODBC Driver Quickstart Guide

How to Configure the DSN (Data Source Name)?

Step 1: Open the ODBC Administrator Note: Use the ODBC Administrator that matches the bitness of the driver you are using. See http://www.simba.com/wp-content/uploads/2010/10/HOW-TO-32-bit-vs-64-bit-ODBC-Data-Source-Administrator.pdf for information.

Page | 16

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 2: Choose the System DSN tab.

Step 3: Choose the “Sample Simba Cassandra DSN” and press “Configure…”

Page | 17

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 4:

• Change the Host to the IP or hostname of your Cassandra server.

• Change the port to the port that Cassandra is running on. Note: 9160 is the default port for Cassandra.

• Change the database to “faa” to access the “airline” table that was created earlier, or the name of the database that has your data in it.

Page | 18

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 5: Press the “Test” button to confirm that your configuration is correct. You should see the a dialog which indicates a successful test, and lists the available catalogs in Cassandra.

Step 6: Press the “OK” button to save the configuration.

Page | 19

Simba Apache Cassandra ODBC Driver Quickstart Guide

Connect from Excel How do I connect and make a basic query with the Simba Apache Cassandra Driver to Excel? Note: The version of Excel used is Excel 2010 32-bit, however the driver will work with any version and bitness of Excel.

Step 1: Open Excel Step 2: Choose the Data tab, then choose “From Other Data Sources” and select “From Data Connection Wizard”.

Page | 20

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 3: Choose “ODBC DSN” from the list and press “Next >”. DSN stands for Data Source Name, which is what was configured when installing and configuring the driver. Essentially, it’s a preconfigured and stored set of connection settings which allow you to easily connect a driver to the data source.

Step 4: Choose the “Sample Simba Cassandra DSN” (or the DSN that you have created and configured) from the list and press “Next >”.

Page | 21

Simba Apache Cassandra ODBC Driver Quickstart Guide

a. If you see the following image, the connection to the driver did not succeed.

b. If you press the “Test Connection” button will give you the following dialog.

c. Issue Diagnosis: Bitness is incorrectly matched. You must match the bitness of the application with the bitness of the driver to correctly connect such as use 32-bit Excel with a 32-bit driver, or 64-bit Excel with a 64-bit driver. See Architecture Mismatch Problems (page 31) for more information.

Page | 22

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 5: Choose the table that you wish to query and press the “Finish” button.

Step 6: Choose the location for your returned data. Leave it as “=$A$1” and press the “OK” button.

Page | 23

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 7: Wait while data is returned.

Congratulations, your data is now available from Excel.

Page | 24

Simba Apache Cassandra ODBC Driver Quickstart Guide

Connect from Tableau How do I connect and make a basic query with the Simba Apache Cassandra Driver to Tableau? Note: The version of Tableau used is 8.0, however the driver should work without problems in Tableau 7 as well.

Step 1: Open Tableau. Step 2: Select “Connect to data”

Page | 25

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 3: Choose “Other Databases (ODBC)” at the bottom of the list.

Page | 26

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 4: Select the “Sample Simba Cassandra DSN” (or the DSN that you have created and configured) from the DSN drop-down and press the “Connect” button.

a. You may see the following dialog if there is an error connecting to the driver.

Page | 27

Simba Apache Cassandra ODBC Driver Quickstart Guide

b. Issue Diagnosis: Bitness incorrect, using the 64-bit driver.

At the time of this writing, Tableau is only available as a 32-bit application, so you must use a 32-bit driver. You can confirm the bitness of the driver by pressing the “Show Details” button and ensuring that the driver DLL name is SimbaCassandraODBC32.dll. See Architecture Mismatch Problems (page 31) for more information.

Step 5: Select the “Single Table” option and press the magnifying glass to open the list of tables.

Page | 28

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 6: Choose one of the tables to query and press the “Select” button.

Step 7: Press OK to load the selected table.

Page | 29

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 8: If a warning comes up, press OK as this will not affect operation of the driver. This warning is displayed because Tableau sees only a generic driver and attempts to determine what the capabilities are on its own. The warning does not affect how the driver will operate in Tableau.

Step 9: Choose to connect live so that Tableau does not import all of the data and you work on the data in Cassandra.

Page | 30

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 10: The table will be loaded into Tableau with the columns listed as dimensions and measures depending on data type. From here, you can create reports on the table you selected.

Congratulations, your data is now available for visualization in Tableau.

Page | 31

Simba Apache Cassandra ODBC Driver Quickstart Guide

Troubleshooting

Architecture Mismatch Problems If you encounter an error message similar to “The specified DSN contains an architecture mismatch between the Driver and Application”, then the bitness of the application does not match the bitness of the driver. You are likely connecting a 32-bit application to a 64-bit driver, or vice versa. Please ensure that the bitness of your application matches the bitness of driver that you are trying to use.

To determine the bitness of Excel: Excel 2007 and earlier These versions of Excel are strictly 32-bit.

Excel 2010 Step 1: Click on the “File” tab.

Page | 32

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 2:

Click on the “Help” item on the left-hand side.

Page | 33

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 3:

Look at the version that is displayed on the help page. If Excel is 32-bit it will show “(32-bit)” (as pictured) while if it is 64-bit it will show “(64-bit)”.

Excel 2013 Step 1:

Click on the “FILE” tab.

Page | 34

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 2:

Click on the “Account” item on the left-hand side.

Step 3: Click on the “About Excel” button on the right side.

Page | 35

Simba Apache Cassandra ODBC Driver Quickstart Guide

Step 4:

Check the version string in the pop-up dialog. If Excel is 32-bit, it will show “32-bit” in the string, if it is 64-bit then it will show “64-bit”.

To determine the bitness of Tableau:

At the time of writing, all versions of Tableau are 32-bit.