Delete old digital tables
This commit is contained in:
parent
7e15b298b2
commit
f04f8bb0ef
@ -1,6 +0,0 @@
|
||||
config {
|
||||
type: "declaration",
|
||||
schema: "pphe_five9_raw",
|
||||
name: "DIGITAL_SOURCE",
|
||||
description: ""
|
||||
}
|
||||
@ -1,49 +0,0 @@
|
||||
config {
|
||||
type: "table",
|
||||
schema: "pphe_five9_stg",
|
||||
assertions: {
|
||||
uniqueKey: ["CUSTOMER_ID", "TIMESTAMP_MILLISECOND"],
|
||||
nonNull: ["CUSTOMER_ID", "AGENT_GROUP_ID", "DISPOSITION_ID", "MEDIA_TYPE_ID",
|
||||
"CAMPAIGN_ID", "CAMPAIGN_GROUP_ID", "CAMPAIGN_GROUP", "SKILL_ID"]
|
||||
},
|
||||
tags: ["daily"],
|
||||
description: "DIGITAL data with mappings"
|
||||
}
|
||||
|
||||
select dl.TIMESTAMP,
|
||||
replace(safe_cast(safe_cast(dl.DATE as date) as string), '-', '') DATE,
|
||||
dl.HOUR_OF_DAY,
|
||||
dl.MONTH,
|
||||
dl.YEAR,
|
||||
dl.AGENT_ID,
|
||||
dl.AGENT_NAME,
|
||||
a.LANGUAGES,
|
||||
a.CODE LANGUAUGE_ID,
|
||||
a.AGENT_GROUP_ID,
|
||||
dl.AGENT_GROUP,
|
||||
d.DISPOSITION_ID,
|
||||
dl.DISPOSITION,
|
||||
dl.MEDIA_TYPE,
|
||||
m.MEDIA_TYPE_ID,
|
||||
c.CAMPAIGN_ID,
|
||||
dl.CAMPAIGN,
|
||||
c.CAMPAIGN_GROUP_ID,
|
||||
c.CAMPAIGN_GROUP,
|
||||
dl.SKILL,
|
||||
s.SKILL_ID,
|
||||
dl.HANDLE_TIME,
|
||||
dl.TRANSFERS_TO_SKILL,
|
||||
dl.INTERACTIONS,
|
||||
dl.CUSTOMER_ID,
|
||||
dl.TIMESTAMP_MILLISECOND
|
||||
from ${ref("stg_DIGITAL_SOURCE")} dl
|
||||
left join ${ref("stg_AGENT")} a
|
||||
on dl.AGENT_ID = a.AGENT_ID
|
||||
left join ${ref("stg_DISPOSITION")} d
|
||||
on dl.DISPOSITION = d.DISPOSITION
|
||||
left join ${ref("stg_CAMPAIGN")} c
|
||||
on dl.CAMPAIGN = c.CAMPAIGN
|
||||
left join ${ref("stg_MAPPING_SKILL")} s
|
||||
on dl.SKILL = s.SKILL
|
||||
left join ${ref("stg_MAPPING_MEDIA_TYPE")} m
|
||||
on dl.MEDIA_TYPE = m.MEDIA_TYPE
|
||||
@ -1,14 +0,0 @@
|
||||
config {
|
||||
type: "table",
|
||||
schema: "pphe_five9_stg",
|
||||
assertions: {
|
||||
uniqueKey: ["CUSTOMER_ID", "TIMESTAMP_MILLISECOND"],
|
||||
nonNull: ["CUSTOMER_ID"]
|
||||
},
|
||||
tags: ["daily"],
|
||||
description: "Daily load of DIGITAL_SOURCE table from raw"
|
||||
}
|
||||
|
||||
select
|
||||
*
|
||||
from ${ref("DIGITAL_SOURCE")}
|
||||
Loading…
Reference in New Issue
Block a user