brooklyn-data / dbt_artifacts

A dbt package for modelling dbt metadata. https://brooklyn-data.github.io/dbt_artifacts
Apache License 2.0
333 stars 126 forks source link

[Bug]: Syntax error while creating all staging models in dbt artifacts #422

Open TanviBhagwat23 opened 8 months ago

TanviBhagwat23 commented 8 months ago

Overview

While implementing dbt artifacts it gives syntax error for all staging models :

SQL compilation error: syntax error line 14 at position 66 unexpected ','. syntax error line 14 at position 115 unexpected 'as'. syntax error line 14 at position 123 unexpected ')'. syntax error line 14 at position 125 unexpected 'as'. This is due to '-' getting appended instead of || in macro generate_surrogate_key.sql

How to reproduce

Expected behaviour

It was expected to generate below statement instead select md5(cast(coalesce(cast(command_invocation_id as TEXT), '') || '-' || coalesce(cast(node_id as TEXT), '') as TEXT)) as model_execution_id

Screenshots

dbt_metrics_issue

Environment

Results of running dbt --version: 1.2

# Add the results here

Please paste the contents of your packages.yml file here:

packages:
  ...

packages:

TanviBhagwat23 commented 8 months ago

packages: