Redshift

Configuration

Prism uses the psycopg2-binary module to instantiate and configure the Redshift connector. The specified configurations required in profile.yml are:

  • autocommit: toggle whether the connection commits changes to the database after executing. The default is True.

  • host: the hostname of Amazon Redshift cluster.

  • port: the port number of the Amazon Redshift cluster.

  • database: the name of the database to which you want to connect.

  • user: the user name to use for authentication.

  • password: the password to use for authentication

For more information, see here the AWS Redshift Connector documentation.

profile.yml
<profile name here>: # change this!
   adapters:
     <redshift adapter name here>: # change this!
       type: redshift
       autocommit: True
       host:
       port:
       database:
       user:
       password:

Under the hood, Prism takes care of parsing the configuration variables and establishing a connection to your Redshift cluster.

hooks.sql()

You can run queries against the Redshift cluster using the hooks.sql function:

def run(self, tasks, hooks):
    df = hooks.sql(
        adapter_name="<redshift adapter name>",
        query="SELECT * FROM table"
    )

Last updated