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: "even"
  }
}
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