Amazon Redshift

Redshift specific options can be applied to datasets using the redshift configuration parameter.

Distributing data

You can configure how Redshift distributes data in your cluster by configuring the distStyle and distKey properties.

config {
  type: "table",
  redshift: {
    distKey: "user_id",
    distStyle: "key"
  }
}
SELECT user_id FROM ...

This query compiles to the following statement:

CREATE TABLE "dataform"."example"
DISTKEY(user_id)
DISTSTYLE even
AS SELECT user_id FROM ...

Sorting data

You can also configure how Redshift sorts data in your datasets with the sortKeys and sortStyle properties.

config {
  redshift: {
    sortKeys: [ "ts" ],
    sortStyle: "compound"
  }
}
SELECT 1 AS ts

Binding views

By default, all views in Redshift are created as late binding views. This can be changed by setting the bind property in the redshift configuration block.

config {
  type: "view",
  redshift: {
    bind: true
  }
}
SELECT 1 AS ts