stitch_utils

stitch_utils

Created by dbt-labs

Installation

dbt version required: >=1.2.0, <2.0.0

Include the following in your packages.yml file:

packages:
  - package: dbt-labs/stitch_utils
    version: 0.5.0

Run dbt deps to install the package.

For more information on using packages in your dbt project, check out the dbt Documentation.

Important Notice: dbt Labs does not certify or confirm the integrity, operability, effectiveness, or security of any Packages. Please read the dbt Labs Package Disclaimer

README

(View on GitHub)

Stitch utilities

coalesce_fields (source)

This macro coalesces fields that Stitch splits by datatype as a result of incremental loading.

The argument relation takes a Stitch-loaded table relation, either:

  • by dbt source() expression
  • by dbt ref() expression
  • by calling dbt adapter function adapter.get_relation(schema_name, table_name) or api.Relation.create(identifier, schema, database, type='table')

If a Stitch-loaded table contains columns field, field__fl, and field__st, this macro will return a select statement with a combined column field of type string.

Usage:

{{ stitch_utils.coalesce_fields(relation = source('stitch','table_name')) }}