Loading Data from Amazon Redshift

This section describes how you can connect Amazon Redshift with Exasol and then load data. To view details about data type mappings or to migrate data, see the Amazon Redshift to Exasol migration script, in our GitHub repository.

Download Driver

Download the compatible JDBC 4.2 driver from the AWS Documentation.

Add JDBC Driver

To add a JDBC driver, you must create a configuration file called settings.cfg. Use the below settings to create the file, replacing the JAR entry with the name of the jar file you downloaded:

DRIVERNAME=Redshift
JAR=redshift-jdbc42-2.1.0.9.jar
DRIVERMAIN=com.amazon.redshift.jdbc42.Driver
PREFIX=jdbc:redshift:
NOSECURITY=YES
FETCHSIZE=100000
INSERTSIZE=-1

Follow the procedure described in Add JDBC Drivers to upload the settings.cfg configuration file and the JDBC driver jar file(s).

Run Statement

Exasol recommends you create a connection string.

CREATE CONNECTION jdbc_connection_1
TO 'jdbc:redshift://example_cluster123.some_region.redshift.amazonaws.com:5439/dev' 
USER 'awsuser' 
IDENTIFIED BY'some_password';

Run the following statement to check the connection.

import from jdbc at jdbc_connection_1 statement 'select 42';

Load Data

You can use the IMPORT statement to load data using the connection you created above. IMPORT supports loading data from a table or a SQL statement.

Possible Errors and Solutions

Error Message 1

[ETL-5] JDBC-Client-Error: Connecting to 'jdbc:redshift://example_cluster123.some_region.redshift.amazonaws.com:5439/dev' as user='awsuser' failed: [Amazon](500150) Error setting/closing connection: Error loading the keystore . (Session: 1622834984232180908)

Solution

Ensure that the settings.cfg file contains NOSECURITY=YES.

Error Message 2

[ETL-5] JDBC-Client-Error: Connecting to 'jdbc:redshift://example_cluster123.some_region.redshift.amazonaws.com:5439/dev' as user='awsuser' failed: [Amazon](500150) Error setting/closing connection: Connection timed out. (Session: 1622834984232180908)

Solution

Check Security Groups on Redshift side to allow your VM / Cluster to connect to Redshift.

Error Message 3

[ETL-5] JDBC-Client-Error: Connecting to 'jdbc:redshift://example_cluster123.some_region.redshift.amazonaws.com:5439/dev' as user='awsuser' failed: [Amazon](500150) Error setting/closing connection: UnknownHostException. (Session: 1622834984232180908)

Solution

Ensure a DNS server is configured for the database.

Error Message 4

[ETL-5] JDBC-Client-Error: Connecting to 'jdbc:redshift://example_cluster123.some_region.redshift.amazonaws.com:5439/dev' as user='awsuser' failed: SSL error: PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed

Solution

Add ;ssl=false to the connection string, for example:

jdbc:redshift://example_cluster123.some_region.redshift.amazonaws.com:5439/dev;ssl=false