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

43 lines
1.3 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-10 14:30:53 +00:00
object_to_string('bank'),
object_to_string('logo'),
2022-03-22 04:03:52 +00:00
adapter.quote('name'),
boolean_to_string('active'),
2022-05-10 14:30:53 +00:00
object_to_string('balance'),
2022-03-22 04:03:52 +00:00
'checksum',
'checksum_1',
2022-05-10 14:30:53 +00:00
object_to_string(adapter.quote('location')),
2022-03-22 04:03:52 +00:00
array_to_string('contracts'),
'createdat',
array_to_string('documents'),
2022-05-10 14:30:53 +00:00
object_to_string('statistic'),
2022-03-22 04:03:52 +00:00
'updatedat',
array_to_string('categories'),
array_to_string('inventories'),
'identifycode',
'searchstring',
2022-05-10 14:30:53 +00:00
array_to_string('reconciledays'),
2022-03-22 04:03:52 +00:00
'contractnumber',
2022-05-10 14:30:53 +00:00
object_to_string('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