redshift>: Redshift operations

redshift> operator runs queries and/or DDLs on Redshift.

    # port: 5439
    database: production_db
    user: app_user
    ssl: true
    schema: myschema
    # strict_transaction: false

  redshift>: queries/dedup_master_table.sql
  create_table: dedup_master

  redshift>: queries/create_summary_table_ddl.sql

  redshift>: queries/join_log_with_master.sql
  insert_into: summary_table

  redshift>: select_members.sql
  store_last_results: first

    member: ${redshift.last_results}
    mail>: body.txt
    subject: Hello, ${}!
    to: [${}]


When you set those parameters, use digdag secrets command.

  • aws.redshift.password: NAME

    Optional user password to use when connecting to the Redshift database. If you want to use multiple credentials, use password_override option.


  • redshift>: FILE.sql

    Path of the query template file. This file can contain ${...} syntax to embed variables.


    redshift>: queries/complex_queries.sql
  • create_table: NAME

    Table name to create from the results. This option deletes the table if it already exists.

    This option adds DROP TABLE IF EXISTS; CREATE TABLE AS before the statements written in the query template file. Also, CREATE TABLE statement can be written in the query template file itself without this command.


    create_table: dest_table
  • insert_into: NAME

    Table name to append results into.

    This option adds INSERT INTO before the statements written in the query template file. Also, INSERT INTO statement can be written in the query template file itself without this command.


    insert_into: dest_table
  • download_file: NAME

    Local CSV file name to be downloaded. The file includes the result of query.


    download_file: output.csv
  • store_last_results: false | first | all

    Whether to store the query results to redshift.last_results parameter. Default: false.

    Setting first stores the first row to the parameter as an object (e.g. ${redshift.last_results.count}).

    Setting all stores all rows to the parameter as an array of objects (e.g. ${redshift.last_results[0].name}). If number of rows exceeds limit, task fails.


    store_last_results: first
    store_last_results: all
  • database: NAME

    Database name.


    database: my_db
  • host: NAME

    Hostname or IP address of the database.


  • port: NUMBER

    Port number to connect to the database. Default: 5439.


    port: 2345
  • user: NAME

    User to connect to the database


    user: app_user
  • ssl: BOOLEAN

    Enable SSL to connect to the database. Default: false.


    ssl: true
  • schema: NAME

    Default schema name. Default: public.


    schema: my_schema
  • strict_transaction: BOOLEAN

    Whether this operator uses a strict transaction to prevent generating unexpected duplicated records just in case. Default: true. This operator creates and uses a status table in the database to make an operation idempotent. But if creating a table isn’t allowed, this option should be false. If the query that created the status table completed 24 hours ago, this operator drop the table in the cleanup step.


    strict_transaction: false
  • status_table_schema: NAME

    Schema name of status table. Default: same as the value of schema option.


    status_table_schema: writable_schema
  • status_table: NAME

    Table name prefix of status table. Default: __digdag_status.


    status_table: customized_status_table
  • connect_timeout: NAME

    The timeout value used for socket connect operations. If connecting to the server takes longer than this value, the connection is broken. Default: 30s(30 seconds).


    connect_timeout: 30s
  • socket_timeout: NAME

    The timeout value used for socket read operations. If reading from the server takes longer than this value, the connection is closed. Default: 1800s(1800 seconds).


    socket_timeout: 1800s
  • password_override: NAME

    Secret key name that has a non-default database password as its value. This would be useful whey you want to use multiple database credentials. If it’s set, Digdag looks up secrets with this value as a secret key name. If not, the default secret key aws.redshift.password is used.

    Examples (let’s say you’ve already added a secret key value aws.redshift.another_password=password1234):

    password_override: another_password
  • status_table_cleanup: TIME VALUES

    Specifies the period of time to clean up the status_table. When “strict_transaction: true” (default), the status_table will be created. status_table will be deleted when the status_table_cleanup period expires and the redshift operator is executed. Default: 24h(24 hours).


    status_table_cleanup: 5s