I am new to using dbt and having trying it out on aws redshift
Currently I can set the encoding of a column using a create statement outside of dbt
as
create table fact_sales (
id integer,
date date NOT NULL encode az64...
)
via dbt I am able to control the data type of the project as
select
id::integer,
date::date
FROM stg.sales
Is there a way to set the encode az64
via dbt?
I was able to solve this with the following strategy
# model.sql
WITH
/* transform steps */
result as (
/* cast your projections explicitly */
SELECT
id::integer,
date::date
FROM _intermediate_step_table;
),
SELECT * FROM final
post_hooks
queryReference: https://docs.getdbt.com/reference/resource-configs/pre-hook-post-hook
PROS:
schema.yml
as explained in the discussion in the github issue thread this is the only sane way I could do this, without jumping hoopsCONS:
ALTERNATE:
In this case
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.