dbt-duckdb icon indicating copy to clipboard operation
dbt-duckdb copied to clipboard

dbt_utils with duckdb

Open QishunX opened this issue 1 year ago • 1 comments

My dbt model read table from database, and union them. My code is like this: {% set dm_relations = dbt_utils.get_relations_by_pattern('ex_%company%', 'client_name') %}

{{ dbt_utils.union_relations( relations=dm_relations, ) }}

if I want to read file from s3, how to change this code to read the file has same pattern and union them?

QishunX avatar Nov 08 '23 15:11 QishunX

Hey @QishunX! Have you checked out DuckDB's bult-in glob utilities for files? https://duckdb.org/docs/data/multiple_files/overview.html

That would be my recommendation here, but if that won't work for some reason, let me know and we'll see what else we can come up with.

jwills avatar Nov 08 '23 15:11 jwills