dbt-labs / dbt-utils

Utility functions for dbt projects.
https://hub.getdbt.com/dbt-labs/dbt_utils/latest/
Apache License 2.0
1.38k stars 499 forks source link

Update BQ deduplicate macro to support partition pruning downstream #929

Open austinclooney opened 4 months ago

austinclooney commented 4 months ago

resolves https://github.com/dbt-labs/dbt-utils/issues/928

Problem

The current BQ deduplicate macro will not work for a view as it doesn't allow partition pruning downstream of the macro.

Solution

Add an an optional parameter that explicitly selects the partition by columns outside of the array_agg

Checklist