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

42 lines
1.2 KiB
MySQL
Raw 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('users_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_id',
'code',
2022-05-10 14:30:53 +00:00
object_to_string('info'),
2022-03-22 04:03:52 +00:00
adapter.quote('name'),
2022-05-10 14:30:53 +00:00
object_to_string('team'),
object_to_string('zalo'),
object_to_string('email'),
object_to_string('phone'),
object_to_string('avatar'),
2022-03-22 04:03:52 +00:00
boolean_to_string('banned'),
'segment',
2022-05-10 14:30:53 +00:00
object_to_string('facebook'),
2022-03-22 04:03:52 +00:00
boolean_to_string('hasorder'),
2022-05-10 14:30:53 +00:00
object_to_string('referral'),
2022-03-22 04:03:52 +00:00
array_to_string('segments'),
'createdat',
2022-05-10 14:30:53 +00:00
object_to_string('statistic'),
2022-03-22 04:03:52 +00:00
'updatedat',
2022-05-10 14:30:53 +00:00
object_to_string('membership'),
2022-03-22 04:03:52 +00:00
'registerfrom',
'searchstring',
boolean_to_string('isupdatedinfo'),
2022-05-10 14:30:53 +00:00
object_to_string('identification'),
2022-03-22 04:03:52 +00:00
'lastactivatedat',
'lastviewnotificationat',
]) }} as _airbyte_users_hashid,
tmp.*
from {{ ref('users_ab2') }} tmp
-- users
where 1 = 1