Connecting to a Snowflake database from Altair SLC on Linux

IanBD
IanBD
Altair Employee
edited October 15 in Altair RapidMiner

If you have data stored in a Snowflake database, you can connect using the ODBC driver for Snowflake. To install the connection software you need to:

    1. Download and install the Snowflake ODBC driver (.tar.gz) from the Snowflake client repository. SLC currently supports only 64-bit versions from 2.21.5.
    2. Once the file is downloaded, change directory (cd) to the /opt folder and extract the contents using the following command:
      tar xzf download-path/snowflake_linux_version.tar.gz
      • Where download path is the absolute path to the download location, and version is the downloaded version of the Snowflake ODBC driver.
      • When complete, the Snowflake ODBC driver archive is unpacked into the /opt folder
    3. Add the Snowflake libraries to the shared library cache, to do this:
      • Change directory (cd) to the /etc folder.
      • View the contents of the ld.so.conf file.
        • If ld.so.conf references a separate folder through an include statement:
          Create a file called slc.conf in that folder, and add the line /opt/snowflake_odbc/lib to the slc.conf file.
        • If ld.so.conf contains a list of folders:
          Add the line /opt/snowflake_odbc/lib to the file.
        • Run ldconfig.
    4. Include the data source name (DSN) information in the ODBC files. The unixODBC installation adds the files /etc/odbc.ini and /etc/odbcinst.ini to your system, if the files do not exist.
      • Add the following lines to /etc/odbc.ini:
        [Snowflake] Description=SnowflakeDB Driver=SnowflakeDSIIDriver Locale=en-US SERVER=server-name schema=schema-name PORT=port-number SSL=on ACCOUNT=account-name WAREHOUSE=warehouse-name Database=database-name
      • Add the following lines to /etc/odbcinst.ini:
        [SnowflakeDSIIDriver]
        APILevel=1
        ConnectFunctions=YYY
        Description=Snowflake DSII
        Driver=/opt/snowflake_odbc/lib/libSnowflake.so
        DriverODBCVer=driver-version
        SQLLevel=1
        UsageCount=1

        Where you replace driver-version with your corresponding driver version.

    5. Once the driver has been installed, test the database connectivity with the following SAS language program:
      LIBNAME DATASRC SNOWFLAKE USER=user-name PASSWORD=password         ACCOUNT=account-id WAREHOUSE=warehouse-name         SCHEMA=schema-name DATABASE=dbase;
      PROC DATASETS LIBRARY=DATASRC; RUN;
      • In the LIBNAME statement, replace user-name and password with your user name and password for the Snowflake account-id server. Replace dbase with the name of the Snowflake database, schema-name with the database schema, and warehouse-name with the warehouse hosting the Snowflake database.
      • The DATASETS procedure returns the names of all tables in the selected database; for databases with large numbers of tables, this program might take some time to run.