How to specify distribution/sort style and column encoding for dbt seeds in Redshift?

How to specify distribution and sort style for dbt seeds?

There are no .sql files associated with seeds. How do we define the config? And how do we define column encoding algorithms?

Hey @evgeniy, as far as I know you can’t define dist/sort style for seeds. In general, you probably shouldn’t need to though as they’re small files, so even if the seed isn’t on the same node it would be trivial for Redshift to copy it over.

With that said, if you do need to configure this then there’s a workaround: you could make a model that just passes the seed through:

-- models/my_seed_with_dist_key_set.sql
{{ config(materialized='table',  sort='id',  dist='received_at') }}

select * from {{ ref('my_seed') }}

and when that gets materialized it will behave as you’d expect. It’s a bit suboptimal because you’d have two copies of the table in your warehouse, but you can materialize your seeds into a different schema that your BI tools etc can’t access if you want to.

This would also be a good thing to add as an issue on the dbt-redshift repo.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.