dbt-selly/models/generated/airbyte_ctes/unibag/suppliers_ab3.sql

41 lines
1.1 KiB
MySQL
Raw Permalink Normal View History

2022-03-22 04:03:52 +00:00
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
unique_key = '_airbyte_ab_id',
schema = "_airbyte_unibag",
tags = [ "top-level-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('suppliers_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_id',
'tax',
2022-05-11 04:21:03 +00:00
'bank',
'logo',
2022-03-22 04:03:52 +00:00
adapter.quote('name'),
boolean_to_string('active'),
'checksum',
'checksum_1',
2022-05-11 04:21:03 +00:00
adapter.quote('location'),
2022-03-22 04:03:52 +00:00
array_to_string('contracts'),
'createdat',
array_to_string('documents'),
2022-05-11 04:21:03 +00:00
'statistic',
2022-03-22 04:03:52 +00:00
'updatedat',
array_to_string('categories'),
array_to_string('inventories'),
'identifycode',
'searchstring',
'contractnumber',
2022-05-11 04:21:03 +00:00
'reviewstatistic',
2022-03-22 04:03:52 +00:00
'contractsignedat',
array_to_string('emailforinvoices'),
'contractexpiredat',
boolean_to_string('sendinvoicerequesteveryday'),
]) }} as _airbyte_suppliers_hashid,
tmp.*
from {{ ref('suppliers_ab2') }} tmp
-- suppliers
where 1 = 1