visch
07/22/2021, 5:22 PMvisch
07/22/2021, 5:24 PM_sdc_extracted_at etctaylor
07/22/2021, 7:09 PMselect *. 😛
but the real answer would be to use https://github.com/dbt-labs/dbt-utils#star-source and include the columns you don't want to select. You could also make a macro that you build once which removes the columns you don't want and then just reference that macrovisch
07/22/2021, 7:14 PMselect * being wrong. In my context it's probably ok, but I think I'd 100% agree in an analytics context (and I bet you'll end up being right even about my context)visch
07/22/2021, 7:15 PM{% macro cleaned_source(source_name, table_name) %}
select
{{ dbt_utils.star(from=source(source_name, table_name), except=["_sdc_received_at", "_sdc_batched_at", "_sdc_extracted_at", "_sdc_deleted_at", "_sdc_table_version", "_sdc_sequence"]) }}
from {{ source(source_name, table_name) }}
{% endmacro %}
example stage model file
with source as (
{{ cleaned_source('source_name', 'table_name') }}
), final AS (
select
*
from source
)
select * from final
Thanks againvisch
07/22/2021, 7:15 PMtaylor
07/22/2021, 7:27 PMvisch
07/22/2021, 7:33 PM