Accessing Data from Amazon Redshift


With Spotfire®, you can connect to, access, and analyze your Amazon Redshift data. In this article, you learn how to use Spotfire’s built-in data connector for Amazon Redshift.

With the Amazon Redshift connector, you can also access shared data. This enables you to perform cross-database queries (inter-account and cross-account). For more information about data-sharing, see Announcing Amazon Redshift data sharing.

Before you start

Here are some things you need before you can access your Amazon Redshift data in Spotfire:

Creating a new connection to access data from Amazon Redshift

To access your Amazon Redshift data in Spotfire, create a connection to your Amazon Redshift cluster.

  1. In Spotfire, open the Files and data flyout and select Connect to.

  2. In the list of connectors, select Amazon Redshift. Then click New connection.

  3. In the Amazon Redshift Connection dialog, enter the information for your Amazon Redshift cluster. Typically, the following information is required:

  4. When you have entered the required information, click Connect.  

  5. In the next step, the Views in Connection dialog, select the data you want to analyze in Spotfire. When you are happy with your selection, click OK.

    Note: For shared databases, the top level in the hierarchy displays both the catalog name and the schema name as catalog_name.schema_name. Spectrum schema names are displayed in the same way (catalog_name.spectrum_name).

  6. The final step is a summary of the data you are about to add to your analysis. Here you can select if you want the data tables to be External (for in-database analysis), Imported, or loaded On-demand.  

  7. To finish creating your data connection and add the data tables to your analysis, click OK.

Tip: When you have created your connection, you can share it in the Spotfire library. Then you and your team members can reuse the connection and easily access that Amazon Redshift data in other analyses.

Access data from Amazon S3 with Redshift Spectrum

If you have data files in Amazon S3, you can access that data in Spotfire with the connector for Amazon Redshift. To make your data from Amazon S3 accessible in Spotfire, use the Redshift Spectrum functionality in Amazon Redshift.

When you have set up Redshift Spectrum tables for your data files in Amazon S3, connect to your Amazon Redshift cluster in Spotfire. The Redshift Spectrum tables show up as data tables that you can select in the Views in Connection dialog.

What types of S3 can I access data from?

What types of data files in Amazon S3 you can access depends on Redshift Spectrum. To learn about what types of data files Redshift Spectrum supports, see the official documentation from Amazon.  

Also remember that in Spotfire, the connector for Amazon Redshift might not support all data types available in your data. If there are unsupported data types in your data, those columns do not show up in Spotfire. See Amazon Redshift Data Types.

Authentication settings in settings profiles and credentials profile

Settings profiles

You can store settings from the Settings for authentication method table (see Details on Amazon Redshift Conneciton) in a settings profile that you can reuse. The purpose is to be able to store settings and their values without having to store the settings in the analysis file. Then you can use those settings automatically when you open a connection in a web client or Automation Services.

A settings profile is similar to a credentials profile. The main difference is that a settings profile does not include the username and password. That means that you can store some settings, which you do not want to store directly in the analysis file, and still have the user enter the username and password when they open the connection.

Tip: One use case for settings profile is to store the Client ID and Client Secret if you use the authentication method Azure AD.

Settings profiles are stored in the web client service configuration, in the configuration file Spotfire.Dxp.Worker.Host.exe.config.

Adding settings profiles for Amazon Redshift in a web client service configuration:

  1. On the computer running Spotfire Server, export the service configuration you want to edit. See the instructions in Manually editing the service configuration files, in the Spotfire Server and Environment Installation and Administration manual.

  2. In the file Spotfire.Dxp.Worker.Host.exe.config, locate or add the Redshift connector settings; Spotfire.Dxp.Data.Adapters.Redshift.Properties.Settings. Add your settings profiles within.
    Example:
     <Spotfire.Dxp.Data.Adapters.Redshift.Properties.Settings>
       <setting name=”SettingProfiles” serializeAs=”Xml”>
          <value>
             <profiles>
                <entry profile=”MySettingsProfile”>
                   <setting name="SecretAccessKey">MySecretAccessKey</setting>
                   <setting name="ClientID">MyClientID</setting>
                </entry>
                <entry profile=”MySecondSettingsProfile”>
                   <setting name="SecretAccessKey">MySecretAccessKey</setting>
                </entry>
             </profiles>
          </value>
       </setting>

    </Spotfire.Dxp.Data.Adapters.Redshift.Properties.Settings>

  3. Save your changes. Then import the service configuration by following the instructions in the Spotfire Server and Environment Installation and Administration manual.

Note: If you have multiple web client services and Automation Services instances, the settings profile must be available on all web player services that you want to use the settings profile on.

Using a settings profile in a connection to Amazon Redshift:

  1. Edit or create a new connection to Amazon Redshift (Files and data > Connect to > Amazon Redshift > New connection).

  2. In the Amazon Redshift Connection dialog, on the Advanced tab, enter the name of the settings profile in the Settings profile field.

Credentials profiles

You can use a credentials profile to log in automatically when you open your Amazon Redshift connection in the Spotfire web client or Automation Services. If your connection has mandatory settings in the Settings for authentication method table, and you do not save the setting values in the connection, you must add those settings in your credentials profile.

To store values for settings from the Settings for authentication method table, add the setting names and their values to the password setting in your credentials profile.

Add the settings as a JSON table. The format of the table is:

{“password”:”mypassword” “firstSettingName”:”value” “secondSettingName”:”value”}

For example:

<entry profile="CredentialsProfileName">

   <username>MyUser<username>

   <password>{“password”:”mypassword” ”SecretAccessKey”:”mysecretaccesskey”}</password>

</entry>

 

See also:

Details on Amazon Redshift Connection

Amazon Redhift Data Types

Supported Functions