What Gets Committed
What Gets Committed
When you make a commit, we’ll commit the following:
- Environment Mappings (folder)
- Subgraphs (folder)
- Jobs (folder)
- Macros (folder)
- Nodes (folder)
- Packages (folder)
- data.yml
- locations.yml
Environment Mappings
Contains the Storage Mappings and environment ID. Each environment will have it's own file.
PROD-ENV.yml (sample)
fileVersion: 1
id: "3"
mappingDefinitions:
SOURCE:
database: SNOWFLAKE_SAMPLE_DATA
schema: TPCH_SF10
TARGET:
database: COA_TESTING
schema: QA
name: Dev Env
type: Environment
Subgraphs
For how Subgraphs behave in the Build Interface, how they map to Jobs, and what gets stored in Git, see Using Subgraphs to Build Your Pipeline.
Each subgraph created will have it's own file. Each node added to a subgraph is a step.
QA_Subgraph.yml (sample)
fileVersion: 1
id: "1"
name: New Subgraph
steps:
- 5b8dea41-4e27-4064-80d3-41177e88fd78
type: Subgraph
Jobs
Each Job created will have it's own file.
QA_JOBS.yml (sample)
excludeSelector: ""
fileVersion: 1
id: "1"
includeSelector: "{ location: SAMPLE name: NATION }"
name: New Job
type: Job
Macros
Each Macro created will have it's own file.
Macros.yml (sample)
fileVersion: 1
id: "1"
macroString: |-
{%- macro even_odd(column) -%}
CASE WHEN MOD({{ column }}, 2) = 0 THEN 'EVEN' ELSE 'ODD' END
{%- endmacro %}
name: macro
type: Macro
Nodes
Each Node created will have it's own file.
Nodes.yml (sample)
- Source node example
- Dimension Node Example
- Fact Node Example
- Stage Node Example
- Persistent Node Example
fileVersion: 1
id: fa3ae643-55c3-4cd8-a860-851c13d5b240
name: SUPPLIER
operation:
database: ""
dataset: ""
deployEnabled: true
description: Supplier data as defined by TPC-H
locationName: SOURCE
metadata:
columns:
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: c2595953-a53d-43b1-bb67-f43c99b11a7e
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
config: {}
dataType: NUMBER(38,0)
defaultValue: ""
description: ""
name: S_SUPPKEY
nullable: false
primaryKey: false
sourceColumnReferences:
- columnReferences: []
transform: ""
transform: ""
uniqueKey: false
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: 0e83d34f-616e-4ef9-a68f-27335ae9becf
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
config: {}
dataType: VARCHAR(25)
defaultValue: ""
description: ""
name: S_NAME
nullable: false
primaryKey: false
sourceColumnReferences:
- columnReferences: []
transform: ""
transform: ""
uniqueKey: false
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: 52436bcb-fc31-4085-b45c-b46c3c477e9c
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
config: {}
dataType: VARCHAR(40)
defaultValue: ""
description: ""
name: S_ADDRESS
nullable: false
primaryKey: false
sourceColumnReferences:
- columnReferences: []
transform: ""
transform: ""
uniqueKey: false
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: a5a8b8c9-d145-4246-8db3-2afbb70779b7
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
config: {}
dataType: NUMBER(38,0)
defaultValue: ""
description: ""
name: S_NATIONKEY
nullable: false
primaryKey: false
sourceColumnReferences:
- columnReferences: []
transform: ""
transform: ""
uniqueKey: false
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: 5b1f4abf-f2b0-4eac-ac28-6628b98c84ff
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
config: {}
dataType: VARCHAR(15)
defaultValue: ""
description: ""
name: S_PHONE
nullable: false
primaryKey: false
sourceColumnReferences:
- columnReferences: []
transform: ""
transform: ""
uniqueKey: false
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: 7a62e69a-da5a-4311-b81c-202e300ad389
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
config: {}
dataType: NUMBER(12,2)
defaultValue: ""
description: ""
name: S_ACCTBAL
nullable: false
primaryKey: false
sourceColumnReferences:
- columnReferences: []
transform: ""
transform: ""
uniqueKey: false
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: 200972c1-d133-47bc-8fac-f9ea4d07cb1a
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
config: {}
dataType: VARCHAR(101)
defaultValue: ""
description: ""
name: S_COMMENT
nullable: true
primaryKey: false
sourceColumnReferences:
- columnReferences: []
transform: ""
transform: ""
uniqueKey: false
join:
joinCondition: FROM {{ ref('SOURCE', 'SUPPLIER') }}
name: SUPPLIER
schema: ""
sqlType: Source
table: SUPPLIER
type: sourceInput
version: 1
type: Node
fileVersion: 1
id: 20ef9752-7e2c-411b-9fa9-10bed025d824
name: DIM_SUPPLIER
operation:
config:
postSQL: ""
preSQL: ""
testsEnabled: true
database: ""
deployEnabled: true
description: Supplier data as defined by TPC-H
isMultisource: false
locationName: SOURCE
materializationType: table
metadata:
appliedNodeTests: []
columns:
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: 228d0101-18f7-43a0-bc75-3132232cc39d
stepCounter: 20ef9752-7e2c-411b-9fa9-10bed025d824
config: {}
dataType: NUMBER
defaultValue: ""
description: ""
isSurrogateKey: true
name: DIM_SUPPLIER_KEY
nullable: true
sourceColumnReferences:
- columnReferences: []
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: 7f74c456-386a-4387-be69-787da7a4f451
stepCounter: 20ef9752-7e2c-411b-9fa9-10bed025d824
config: {}
dataType: NUMBER(38,0)
description: ""
name: S_SUPPKEY
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: c2595953-a53d-43b1-bb67-f43c99b11a7e
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: 8f459f3a-7b1f-4647-93b9-fb8d43618330
stepCounter: 20ef9752-7e2c-411b-9fa9-10bed025d824
config: {}
dataType: VARCHAR(25)
description: ""
name: S_NAME
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: 0e83d34f-616e-4ef9-a68f-27335ae9becf
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: b0b93725-2958-4aeb-82cb-615a48166432
stepCounter: 20ef9752-7e2c-411b-9fa9-10bed025d824
config: {}
dataType: VARCHAR(40)
description: ""
name: S_ADDRESS
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: 52436bcb-fc31-4085-b45c-b46c3c477e9c
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: dbee00ec-48ff-4721-982e-53fa403948cc
stepCounter: 20ef9752-7e2c-411b-9fa9-10bed025d824
config: {}
dataType: NUMBER(38,0)
description: ""
name: S_NATIONKEY
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: a5a8b8c9-d145-4246-8db3-2afbb70779b7
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: 2c0d7531-52a3-4309-a54d-2a457c6b4ba8
stepCounter: 20ef9752-7e2c-411b-9fa9-10bed025d824
config: {}
dataType: VARCHAR(15)
description: ""
name: S_PHONE
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: 5b1f4abf-f2b0-4eac-ac28-6628b98c84ff
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: af228c16-14c0-4d6d-9796-080af7b56b59
stepCounter: 20ef9752-7e2c-411b-9fa9-10bed025d824
config: {}
dataType: NUMBER(12,2)
description: ""
name: S_ACCTBAL
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: 7a62e69a-da5a-4311-b81c-202e300ad389
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: e272311f-cabf-4156-87fe-56cfe7eb03f5
stepCounter: 20ef9752-7e2c-411b-9fa9-10bed025d824
config: {}
dataType: VARCHAR(101)
description: ""
name: S_COMMENT
nullable: true
sourceColumnReferences:
- columnReferences:
- columnCounter: 200972c1-d133-47bc-8fac-f9ea4d07cb1a
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: c938b844-02c0-4a81-93d7-e766e8ac3e07
stepCounter: 20ef9752-7e2c-411b-9fa9-10bed025d824
config: {}
dataType: NUMBER
defaultValue: ""
description: ""
isSystemVersion: true
name: SYSTEM_VERSION
nullable: true
sourceColumnReferences:
- columnReferences: []
transform: ""
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: ee35f28c-12e3-4f24-8adf-661bf8e0cd5e
stepCounter: 20ef9752-7e2c-411b-9fa9-10bed025d824
config: {}
dataType: VARCHAR
defaultValue: ""
description: ""
isSystemCurrentFlag: true
name: SYSTEM_CURRENT_FLAG
nullable: true
sourceColumnReferences:
- columnReferences: []
transform: ""
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: 8aae0912-1027-46e4-9b9d-f66259214724
stepCounter: 20ef9752-7e2c-411b-9fa9-10bed025d824
config: {}
dataType: TIMESTAMP
defaultValue: ""
description: ""
isSystemStartDate: true
name: SYSTEM_START_DATE
nullable: true
sourceColumnReferences:
- columnReferences: []
transform: CAST(CURRENT_TIMESTAMP AS TIMESTAMP)
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: 988f7659-976d-4697-ac46-b08583932f40
stepCounter: 20ef9752-7e2c-411b-9fa9-10bed025d824
config: {}
dataType: TIMESTAMP
defaultValue: ""
description: ""
isSystemEndDate: true
name: SYSTEM_END_DATE
nullable: true
sourceColumnReferences:
- columnReferences: []
transform: CAST('2999-12-31 00:00:00' AS TIMESTAMP)
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: 24043104-eef1-4493-a255-0f3cce3cccef
stepCounter: 20ef9752-7e2c-411b-9fa9-10bed025d824
config: {}
dataType: TIMESTAMP
defaultValue: ""
description: ""
isSystemCreateDate: true
name: SYSTEM_CREATE_DATE
nullable: true
sourceColumnReferences:
- columnReferences: []
transform: CAST(CURRENT_TIMESTAMP AS TIMESTAMP)
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: 2dff18f7-8f8f-486e-bc0c-ee2ccfe11d2d
stepCounter: 20ef9752-7e2c-411b-9fa9-10bed025d824
config: {}
dataType: TIMESTAMP
defaultValue: ""
description: ""
isSystemUpdateDate: true
name: SYSTEM_UPDATE_DATE
nullable: true
sourceColumnReferences:
- columnReferences: []
transform: CAST(CURRENT_TIMESTAMP AS TIMESTAMP)
cteString: ""
enabledColumnTestIDs: []
sourceMapping:
- aliases: {}
customSQL:
customSQL: ""
dependencies:
- locationName: SOURCE
nodeName: SUPPLIER
join:
joinCondition: FROM {{ ref('SOURCE', 'SUPPLIER') }} "SUPPLIER"
name: DIM_SUPPLIER
noLinkRefs: []
name: DIM_SUPPLIER
overrideSQL: false
schema: ""
sqlType: Dimension
type: sql
version: 1
type: Node
fileVersion: 1
id: e20ca58d-ad59-4394-85f5-dc7a9cdeaeeb
name: FCT_SUPPLIER
operation:
config:
postSQL: ""
preSQL: ""
testsEnabled: true
database: ""
deployEnabled: true
description: Supplier data as defined by TPC-H
isMultisource: false
locationName: SOURCE
materializationType: table
metadata:
appliedNodeTests: []
columns:
- appliedColumnTests: {}
columnReference:
columnCounter: a923c827-230b-4331-9258-4f194d73800a
stepCounter: e20ca58d-ad59-4394-85f5-dc7a9cdeaeeb
config: {}
dataType: NUMBER(38,0)
description: ""
name: S_SUPPKEY
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: c2595953-a53d-43b1-bb67-f43c99b11a7e
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: 1e307d0b-d4a8-4da3-9d7c-00651d29e028
stepCounter: e20ca58d-ad59-4394-85f5-dc7a9cdeaeeb
config: {}
dataType: VARCHAR(25)
description: ""
name: S_NAME
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: 0e83d34f-616e-4ef9-a68f-27335ae9becf
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: b7985532-d01f-4481-9a15-40ff02f8dd9a
stepCounter: e20ca58d-ad59-4394-85f5-dc7a9cdeaeeb
config: {}
dataType: VARCHAR(40)
description: ""
name: S_ADDRESS
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: 52436bcb-fc31-4085-b45c-b46c3c477e9c
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: cc210856-e92d-4430-ad11-44c0611f3c16
stepCounter: e20ca58d-ad59-4394-85f5-dc7a9cdeaeeb
config: {}
dataType: NUMBER(38,0)
description: ""
name: S_NATIONKEY
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: a5a8b8c9-d145-4246-8db3-2afbb70779b7
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: e345fdb3-9b7d-48b4-a24e-dba7050c935f
stepCounter: e20ca58d-ad59-4394-85f5-dc7a9cdeaeeb
config: {}
dataType: VARCHAR(15)
description: ""
name: S_PHONE
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: 5b1f4abf-f2b0-4eac-ac28-6628b98c84ff
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: 74a26d8a-7c54-4218-bcb2-40894f32fb3e
stepCounter: e20ca58d-ad59-4394-85f5-dc7a9cdeaeeb
config: {}
dataType: NUMBER(12,2)
description: ""
name: S_ACCTBAL
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: 7a62e69a-da5a-4311-b81c-202e300ad389
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: c76320ab-8ac7-4c84-8fe6-4606be66c527
stepCounter: e20ca58d-ad59-4394-85f5-dc7a9cdeaeeb
config: {}
dataType: VARCHAR(101)
description: ""
name: S_COMMENT
nullable: true
sourceColumnReferences:
- columnReferences:
- columnCounter: 200972c1-d133-47bc-8fac-f9ea4d07cb1a
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: 92727293-9273-47e4-ab15-cf95cf32459d
stepCounter: e20ca58d-ad59-4394-85f5-dc7a9cdeaeeb
config: {}
dataType: TIMESTAMP
defaultValue: ""
description: ""
isSystemCreateDate: true
name: SYSTEM_CREATE_DATE
nullable: true
sourceColumnReferences:
- columnReferences: []
transform: CAST(CURRENT_TIMESTAMP AS TIMESTAMP)
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: a8cf14ec-7a3e-4629-a056-66e034adb18c
stepCounter: e20ca58d-ad59-4394-85f5-dc7a9cdeaeeb
config: {}
dataType: TIMESTAMP
defaultValue: ""
description: ""
isSystemUpdateDate: true
name: SYSTEM_UPDATE_DATE
nullable: true
sourceColumnReferences:
- columnReferences: []
transform: CAST(CURRENT_TIMESTAMP AS TIMESTAMP)
cteString: ""
enabledColumnTestIDs: []
sourceMapping:
- aliases: {}
customSQL:
customSQL: ""
dependencies:
- locationName: SOURCE
nodeName: SUPPLIER
join:
joinCondition: FROM {{ ref('SOURCE', 'SUPPLIER') }} "SUPPLIER"
name: FCT_SUPPLIER
noLinkRefs: []
name: FCT_SUPPLIER
overrideSQL: false
schema: ""
sqlType: Fact
type: sql
version: 1
type: Node
fileVersion: 1
id: b3fe70c0-5b54-48e5-974d-4699e1fdee69
name: STG_SUPPLIER
operation:
config:
insertStrategy: INSERT
postSQL: ""
preSQL: ""
testsEnabled: true
truncateBefore: true
database: ""
deployEnabled: true
description: Supplier data as defined by TPC-H
isMultisource: false
locationName: SOURCE
materializationType: table
metadata:
appliedNodeTests: []
columns:
- appliedColumnTests: {}
columnReference:
columnCounter: 4ccc3937-4514-4af2-ae21-60d87adb0290
stepCounter: b3fe70c0-5b54-48e5-974d-4699e1fdee69
config: {}
dataType: NUMBER(38,0)
description: ""
name: S_SUPPKEY
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: c2595953-a53d-43b1-bb67-f43c99b11a7e
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: a4c44bbf-e44c-4757-ab58-f2211b816acb
stepCounter: b3fe70c0-5b54-48e5-974d-4699e1fdee69
config: {}
dataType: VARCHAR(25)
description: ""
name: S_NAME
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: 0e83d34f-616e-4ef9-a68f-27335ae9becf
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: 13602029-532d-436a-a648-093389a4eafb
stepCounter: b3fe70c0-5b54-48e5-974d-4699e1fdee69
config: {}
dataType: VARCHAR(40)
description: ""
name: S_ADDRESS
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: 52436bcb-fc31-4085-b45c-b46c3c477e9c
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: e2c777ee-d110-4e05-8c58-a8bc3581101c
stepCounter: b3fe70c0-5b54-48e5-974d-4699e1fdee69
config: {}
dataType: NUMBER(38,0)
description: ""
name: S_NATIONKEY
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: a5a8b8c9-d145-4246-8db3-2afbb70779b7
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: 18f59f49-39df-483d-a902-74b857e13cb8
stepCounter: b3fe70c0-5b54-48e5-974d-4699e1fdee69
config: {}
dataType: VARCHAR(15)
description: ""
name: S_PHONE
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: 5b1f4abf-f2b0-4eac-ac28-6628b98c84ff
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: 25316571-032e-4021-ab2a-ee5519cce874
stepCounter: b3fe70c0-5b54-48e5-974d-4699e1fdee69
config: {}
dataType: NUMBER(12,2)
description: ""
name: S_ACCTBAL
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: 7a62e69a-da5a-4311-b81c-202e300ad389
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: a0523871-16e7-4a36-91a8-5d8b801473c7
stepCounter: b3fe70c0-5b54-48e5-974d-4699e1fdee69
config: {}
dataType: VARCHAR(101)
description: ""
name: S_COMMENT
nullable: true
sourceColumnReferences:
- columnReferences:
- columnCounter: 200972c1-d133-47bc-8fac-f9ea4d07cb1a
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
cteString: ""
enabledColumnTestIDs: []
sourceMapping:
- aliases: {}
customSQL:
customSQL: ""
dependencies:
- locationName: SOURCE
nodeName: SUPPLIER
join:
joinCondition: FROM {{ ref('SOURCE', 'SUPPLIER') }} "SUPPLIER"
name: STG_SUPPLIER
noLinkRefs: []
name: STG_SUPPLIER
overrideSQL: false
schema: ""
sqlType: Stage
type: sql
version: 1
type: Node
fileVersion: 1
id: 26bb2aa9-b030-4378-afe1-5e15117dd217
name: PSTG_SUPPLIER
operation:
config:
postSQL: ""
preSQL: ""
testsEnabled: true
database: ""
deployEnabled: true
description: Supplier data as defined by TPC-H
isMultisource: false
locationName: SOURCE
materializationType: table
metadata:
appliedNodeTests: []
columns:
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: d3eed09f-b194-4615-be36-737716bd8ef8
stepCounter: 26bb2aa9-b030-4378-afe1-5e15117dd217
config: {}
dataType: NUMBER
defaultValue: ""
description: ""
isSurrogateKey: true
name: PSTG_SUPPLIER_KEY
nullable: true
sourceColumnReferences:
- columnReferences: []
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: 79c970ac-1115-426a-b7fd-152581af389d
stepCounter: 26bb2aa9-b030-4378-afe1-5e15117dd217
config: {}
dataType: NUMBER(38,0)
description: ""
name: S_SUPPKEY
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: c2595953-a53d-43b1-bb67-f43c99b11a7e
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: 2efce84e-5aa1-4dab-8571-0f09ec03a451
stepCounter: 26bb2aa9-b030-4378-afe1-5e15117dd217
config: {}
dataType: VARCHAR(25)
description: ""
name: S_NAME
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: 0e83d34f-616e-4ef9-a68f-27335ae9becf
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: c5f4e804-0c02-4fc5-9c23-a93a5ac1b72a
stepCounter: 26bb2aa9-b030-4378-afe1-5e15117dd217
config: {}
dataType: VARCHAR(40)
description: ""
name: S_ADDRESS
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: 52436bcb-fc31-4085-b45c-b46c3c477e9c
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: 25142ca7-8f5e-4ddb-9feb-04d447cbf08b
stepCounter: 26bb2aa9-b030-4378-afe1-5e15117dd217
config: {}
dataType: NUMBER(38,0)
description: ""
name: S_NATIONKEY
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: a5a8b8c9-d145-4246-8db3-2afbb70779b7
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: 04691fcb-738e-4b65-a1b8-72385f5a8826
stepCounter: 26bb2aa9-b030-4378-afe1-5e15117dd217
config: {}
dataType: VARCHAR(15)
description: ""
name: S_PHONE
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: 5b1f4abf-f2b0-4eac-ac28-6628b98c84ff
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: 655db749-69c4-41a3-a4f6-3a3e0d3d1699
stepCounter: 26bb2aa9-b030-4378-afe1-5e15117dd217
config: {}
dataType: NUMBER(12,2)
description: ""
name: S_ACCTBAL
nullable: false
sourceColumnReferences:
- columnReferences:
- columnCounter: 7a62e69a-da5a-4311-b81c-202e300ad389
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- appliedColumnTests: {}
columnReference:
columnCounter: 555dde70-2cd1-49c4-854e-40d15a389f97
stepCounter: 26bb2aa9-b030-4378-afe1-5e15117dd217
config: {}
dataType: VARCHAR(101)
description: ""
name: S_COMMENT
nullable: true
sourceColumnReferences:
- columnReferences:
- columnCounter: 200972c1-d133-47bc-8fac-f9ea4d07cb1a
stepCounter: fa3ae643-55c3-4cd8-a860-851c13d5b240
transform: ""
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: c1feba77-82e6-4e3b-82ac-21b250e0f244
stepCounter: 26bb2aa9-b030-4378-afe1-5e15117dd217
config: {}
dataType: NUMBER
defaultValue: ""
description: ""
isSystemVersion: true
name: SYSTEM_VERSION
nullable: true
sourceColumnReferences:
- columnReferences: []
transform: ""
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: 35f93100-d008-44dc-974b-d56097d7e984
stepCounter: 26bb2aa9-b030-4378-afe1-5e15117dd217
config: {}
dataType: VARCHAR
defaultValue: ""
description: ""
isSystemCurrentFlag: true
name: SYSTEM_CURRENT_FLAG
nullable: true
sourceColumnReferences:
- columnReferences: []
transform: ""
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: 621e084f-ca1c-46da-8ebb-0b40cdc61528
stepCounter: 26bb2aa9-b030-4378-afe1-5e15117dd217
config: {}
dataType: TIMESTAMP
defaultValue: ""
description: ""
isSystemStartDate: true
name: SYSTEM_START_DATE
nullable: true
sourceColumnReferences:
- columnReferences: []
transform: CAST(CURRENT_TIMESTAMP AS TIMESTAMP)
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: d20370e0-0db6-4d47-94d9-5fbd2fa948a5
stepCounter: 26bb2aa9-b030-4378-afe1-5e15117dd217
config: {}
dataType: TIMESTAMP
defaultValue: ""
description: ""
isSystemEndDate: true
name: SYSTEM_END_DATE
nullable: true
sourceColumnReferences:
- columnReferences: []
transform: CAST('2999-12-31 00:00:00' AS TIMESTAMP)
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: 88e333b3-8a59-4626-b121-dd2b23c34393
stepCounter: 26bb2aa9-b030-4378-afe1-5e15117dd217
config: {}
dataType: TIMESTAMP
defaultValue: ""
description: ""
isSystemCreateDate: true
name: SYSTEM_CREATE_DATE
nullable: true
sourceColumnReferences:
- columnReferences: []
transform: CAST(CURRENT_TIMESTAMP AS TIMESTAMP)
- acceptedValues:
strictMatch: true
values: []
appliedColumnTests: {}
columnReference:
columnCounter: 09f296b8-5240-4a41-b76f-dea92b245997
stepCounter: 26bb2aa9-b030-4378-afe1-5e15117dd217
config: {}
dataType: TIMESTAMP
defaultValue: ""
description: ""
isSystemUpdateDate: true
name: SYSTEM_UPDATE_DATE
nullable: true
sourceColumnReferences:
- columnReferences: []
transform: CAST(CURRENT_TIMESTAMP AS TIMESTAMP)
cteString: ""
enabledColumnTestIDs: []
sourceMapping:
- aliases: {}
customSQL:
customSQL: ""
dependencies:
- locationName: SOURCE
nodeName: SUPPLIER
join:
joinCondition: FROM {{ ref('SOURCE', 'SUPPLIER') }} "SUPPLIER"
name: PSTG_SUPPLIER
noLinkRefs: []
name: PSTG_SUPPLIER
overrideSQL: false
schema: ""
sqlType: persistentStage
type: sql
version: 1
type: Node
Node Types
These are the Coalesce managed templates. These files can't be changed. If a change is detected, we'll automatically attempt to revert the changes on the next commit.
You can make a copy and use the templates to create a custom node.
Fact-Fact
- create.sql.j2
- definition
- run.sql.j2
{% if node.materializationType == 'table' %}
{{ stage('Create Fact Table') }}
CREATE OR REPLACE TABLE {{ ref_no_link(node.location.name, node.name) }}
(
{% for col in columns %}
"{{ col.name }}" {{ col.dataType }}
{%- if not col.nullable %} NOT NULL
{%- if col.defaultValue | length > 0 %} DEFAULT {{ col.defaultValue }}{% endif %}
{% endif %}
{%- if col.description | length > 0 %} COMMENT '{{ col.description | escape }}'{% endif %}
{%- if not loop.last -%}, {% endif %}
{% endfor %}
)
{%- if node.description | length > 0 %} COMMENT = '{{ node.description | escape }}'{% endif %}
{% elif node.materializationType == 'view' %}
{{ stage('Create Fact View') }}
CREATE OR REPLACE VIEW {{ ref_no_link(node.location.name, node.name) }}
(
{% for col in columns %}
"{{ col.name }}"
{%- if col.description | length > 0 %} COMMENT '{{ col.description | escape }}'{% endif %}
{%- if not loop.last -%},{% endif %}
{% endfor %}
)
{%- if node.description | length > 0 %} COMMENT = '{{ node.description | escape }}'{% endif %}
AS
{% for source in sources %}
{% if loop.first %}SELECT {% endif %}
{% for col in source.columns %}
{{ get_source_transform(col) }} AS "{{ col.name }}"
{%- if not loop.last -%}, {% endif %}
{% endfor %}
{{ source.join }}
{% if not loop.last %} UNION ALL {% endif %}
{% endfor %}
{% endif %}
fileVersion: 1
id: Fact
isDisabled: false
metadata:
defaultStorageLocation: null
error: null
nodeMetadataSpec: |
capitalized: Fact
plural: Facts
short: FCT
tagColor: '#D9A438'
config:
- groupName: Options
items:
- type: materializationSelector
isRequired: true
options:
- table
- view
- type: businessKeyColumns
isRequired: false
- displayName: Enable Tests
attributeName: testsEnabled
type: toggleButton
default: true
- displayName: Pre-SQL
attributeName: preSQL
type: textBox
syntax: sql
isRequired: false
- displayName: Post-SQL
attributeName: postSQL
type: textBox
syntax: sql
isRequired: false
systemColumns:
- displayName: SYSTEM_CREATE_DATE
transform: CAST(CURRENT_TIMESTAMP AS TIMESTAMP)
dataType: TIMESTAMP
placement: end
attributeName: isSystemCreateDate
- displayName: SYSTEM_UPDATE_DATE
transform: CAST(CURRENT_TIMESTAMP AS TIMESTAMP)
dataType: TIMESTAMP
placement: end
attributeName: isSystemUpdateDate
name: Fact
type: NodeType
{% for test in node.tests if config.testsEnabled %}
{% if test.runOrder == 'Before' %}
{{ test_stage(test.name, test.continueOnFailure) }}
{{ test.templateString }}
{% endif %}
{% endfor %}
{% if node.materializationType == 'table' %}
{% if config.preSQL %}
{{ stage('Pre-SQL') }}
{{ config.preSQL }}
{% endif %}
{% set has_business_key = columns | selectattr("isBusinessKey") | list | length > 0 %}
{% for source in sources %}
{% if has_business_key %}
{{ stage('MERGE ' + source.name | string ) }}
MERGE INTO {{ ref_no_link(node.location.name, node.name) }} "TGT"
USING (
SELECT
{% for col in source.columns %}
{{ get_source_transform(col) }} AS "{{ col.name }}"
{%- if not loop.last %}, {% endif %}
{% endfor %}
{{ source.join }})
AS "SRC"
ON
{% for col in source.columns if col.isBusinessKey -%}
{% if not loop.first %}
AND
{% endif %}
"SRC"."{{ col.name }}" = "TGT"."{{ col.name }}"
{% endfor %}
WHEN MATCHED
{% for col in source.columns if not ( col.isBusinessKey or
col.isSystemUpdateDate or
col.isSystemCreateDate) %}
{% if loop.first %}
AND (
{% else %}
OR
{% endif %}
NVL( CAST("SRC"."{{ col.name }}" as STRING), '**NULL**') <> NVL( CAST("TGT"."{{ col.name }}" as STRING), '**NULL**')
{% if loop.last %}
)
{% endif %}
{% endfor %}
THEN UPDATE SET
{%- for col in source.columns if not (col.isBusinessKey or col.isSystemCreateDate) %}
"TGT"."{{ col.name }}" = "SRC"."{{ col.name }}"
{% if not loop.last %}, {% endif %}
{% endfor %}
WHEN NOT MATCHED THEN
INSERT (
{%- for col in source.columns if not col.isSurrogateKey %}
"{{ col.name }}"
{% if not loop.last %}, {% endif %}
{% endfor -%}
)
VALUES (
{%- for col in source.columns if not col.isSurrogateKey %}
"SRC"."{{ col.name }}"
{% if not loop.last %}, {% endif %}
{% endfor -%}
)
{% else %}
{{ stage('Insert ' + source.name | string ) }}
INSERT INTO {{ ref_no_link(node.location.name, node.name) }}
(
{% for col in source.columns %}
"{{ col.name }}"
{%- if not loop.last -%},{% endif %}
{% endfor %}
)
SELECT
{% for col in source.columns %}
{{ get_source_transform(col) }} AS "{{ col.name }}"
{%- if not loop.last -%}, {% endif %}
{% endfor %}
{{ source.join }}
{% endif %}
{% endfor %}
{% if config.postSQL %}
{{ stage('Post-SQL') }}
{{ config.postSQL }}
{% endif %}
{% endif %}
{% if config.testsEnabled %}
{% for test in node.tests %}
{% if test.runOrder == 'After' %}
{{ test_stage(test.name, test.continueOnFailure) }}
{{ test.templateString }}
{% endif %}
{% endfor %}
{% for column in columns %}
{% for test in column.tests %}
{{ test_stage(column.name + ": " + test.name) }}
{{ test.templateString }}
{% endfor %}
{% endfor %}
{% endif %}
Dimension-Dimension
- create.sql.j2
- definition
- run.sql.j2
{% if node.materializationType == 'table' %}
{{ stage('Create Dimension Table') }}
CREATE OR REPLACE TABLE {{ ref_no_link(node.location.name, node.name) }}
(
{% for col in columns %}
"{{ col.name }}" {{ col.dataType }}
{% if col.isSurrogateKey %}
identity
{% endif %}
{%- if not col.nullable %} NOT NULL
{%- if col.defaultValue | length > 0 %} DEFAULT {{ col.defaultValue }}{% endif %}
{% endif %}
{%- if col.description | length > 0 %} COMMENT '{{ col.description | escape }}'{% endif %}
{%- if not loop.last -%}, {% endif %}
{% endfor %}
)
{%- if node.description | length > 0 %} COMMENT = '{{ node.description | escape }}'{% endif %}
{% elif node.materializationType == 'view' %}
{{ stage('Create Dimension View') }}
CREATE OR REPLACE VIEW {{ ref_no_link(node.location.name, node.name) }}
(
{% for col in columns %}
"{{ col.name }}"
{%- if col.description | length > 0 %} COMMENT '{{ col.description | escape }}'{% endif %}
{%- if not loop.last -%},{% endif %}
{% endfor %}
)
{%- if node.description | length > 0 %} COMMENT = '{{ node.description | escape }}'{% endif %}
AS
{% for source in sources %}
{% if loop.first %}SELECT {% endif %}
{% for col in source.columns %}
{% if col.isSurrogateKey or col.isSystemUpdateDate or col.isSystemCreateDate %}
NULL
{% else %}
{{ get_source_transform(col) }}
{% endif %}
AS "{{ col.name }}"
{%- if not loop.last -%}, {% endif %}
{% endfor %}
{{ source.join }}
{% if not loop.last %} UNION ALL {% endif %}
{% endfor %}
{% endif %}
fileVersion: 1
id: Dimension
isDisabled: false
metadata:
defaultStorageLocation: null
error: null
nodeMetadataSpec: |-
capitalized: Dimension
short: DIM
tagColor: '#1E339A'
plural: Dimensions
config:
- groupName: Options
items:
- type: materializationSelector
isRequired: true
default: table
options:
- table
- view
- type: multisourceToggle
enableIf: "{% if node.materializationType == 'table' %} true {% else %} false {% endif %}"
- type: businessKeyColumns
isRequired: true
- type: changeTrackingColumns
isRequired: false
- type: overrideSQLToggle
enableIf: "{% if node.materializationType == 'view' %} true {% else %} false {% endif %}"
- displayName: Enable Tests
attributeName: testsEnabled
type: toggleButton
default: true
- displayName: Pre-SQL
attributeName: preSQL
type: textBox
syntax: sql
isRequired: false
- displayName: Post-SQL
attributeName: postSQL
type: textBox
syntax: sql
isRequired: false
systemColumns:
- displayName: '{{NODE_NAME}}_KEY'
transform: ''
dataType: NUMBER
placement: beginning
attributeName: isSurrogateKey
- displayName: SYSTEM_VERSION
transform: ''
dataType: NUMBER
placement: end
attributeName: isSystemVersion
- displayName: SYSTEM_CURRENT_FLAG
transform: ''
dataType: VARCHAR
placement: end
attributeName: isSystemCurrentFlag
- displayName: SYSTEM_START_DATE
transform: CAST(CURRENT_TIMESTAMP AS TIMESTAMP)
dataType: TIMESTAMP
placement: end
attributeName: isSystemStartDate
- displayName: SYSTEM_END_DATE
transform: CAST('2999-12-31 00:00:00' AS TIMESTAMP)
dataType: TIMESTAMP
placement: end
attributeName: isSystemEndDate
- displayName: SYSTEM_CREATE_DATE
transform: CAST(CURRENT_TIMESTAMP AS TIMESTAMP)
dataType: TIMESTAMP
placement: end
attributeName: isSystemCreateDate
- displayName: SYSTEM_UPDATE_DATE
transform: CAST(CURRENT_TIMESTAMP AS TIMESTAMP)
dataType: TIMESTAMP
placement: end
attributeName: isSystemUpdateDate
name: Dimension
type: NodeType
{% set is_type_2 = columns | selectattr("isChangeTracking") | list | length > 0 %}
{% for test in node.tests if config.testsEnabled %}
{% if test.runOrder == 'Before' %}
{{ test_stage(test.name, test.continueOnFailure) }}
{{ test.templateString }}
{% endif %}
{% endfor %}
{% if node.materializationType == 'table' %}
{% if config.preSQL %}
{{ stage('Pre-SQL') }}
{{ config.preSQL }}
{% endif %}
{% if is_type_2 %}
{% for source in sources %}
{{ stage('MERGE ' + source.name | string) }}
MERGE INTO {{ ref_no_link(node.location.name, node.name) }} "TGT"
USING (
/* New Rows That Don't Exist */
SELECT
{% for col in source.columns if not col.isSurrogateKey %}
{% if col.isSystemVersion %}
1
{% elif col.isSystemCurrentFlag %}
'Y'
{% else %}
{{ get_source_transform(col) }}
{% endif %}
AS "{{ col.name }}",
{% endfor %}
'INSERT_INITAL_VERSION_ROWS' AS "DML_OPERATION"
{{ source.join }}
LEFT JOIN {{ ref_no_link(node.location.name, node.name) }} "DIM" ON
{% for col in source.columns if col.isBusinessKey -%}
{% if not loop.first %}
AND
{% endif %}
{{ get_source_transform(col) }} = "DIM"."{{ col.name }}"
{% endfor %}
WHERE
{% for col in source.columns if col.isBusinessKey -%}
{% if not loop.first %}
AND
{% endif %}
"DIM"."{{ col.name }}" IS NULL
{% endfor %}
UNION ALL
/* New Row Needing To Be Inserted Due To Type-2 Column Changes */
SELECT
{% for col in source.columns if not col.isSurrogateKey %}
{% if col.isSystemVersion %}
"DIM"."{{ col.name }}" + 1
{% elif col.isSystemCurrentFlag %}
'Y'
{% else %}
{{ get_source_transform(col) }}
{% endif %}
AS "{{ col.name }}",
{% endfor %}
'INSERT_NEW_VERSION_ROWS' AS "DML_OPERATION"
{{ source.join }}
INNER JOIN {{ ref_no_link(node.location.name, node.name) }} "DIM" ON
{% for col in source.columns if col.isBusinessKey -%}
{% if not loop.first %}
AND
{% endif %}
{{ get_source_transform(col) }} = "DIM"."{{ col.name }}"
{% endfor %}
WHERE "DIM"."{{ get_value_by_column_attribute("isSystemCurrentFlag") }}" = 'Y'
{% for col in source.columns if (col.isChangeTracking == true) %}
{% if loop.first %}
AND (
{% else %}
OR
{% endif %}
( NVL( CAST({{ get_source_transform(col) }} as STRING), '**NULL**') <> NVL( CAST("DIM"."{{ col.name }}" as STRING), '**NULL**') )
{% if loop.last %}
)
{% endif %}
{% endfor %}
UNION ALL
/* Rows Needing To Be Expired Due To Type-2 Column Changes
In this case, only two columns are merged (version and end date) */
SELECT
{%- for col in source.columns if not col.isSurrogateKey %}
{% if col.isSystemEndDate %}
DATEADD(MILLISECONDS, -1, CAST(CURRENT_TIMESTAMP AS TIMESTAMP))
{% elif col.isSystemCurrentFlag %}
'N'
{% else %}
"DIM"."{{ col.name }}"
{% endif %}
AS "{{ col.name }}",
{% endfor -%}
'update_expired_version_rows' AS "DML_OPERATION"
{{ source.join }}
INNER JOIN {{ ref_no_link(node.location.name, node.name) }} "DIM" ON
{% for col in source.columns if col.isBusinessKey -%}
{% if not loop.first %}
AND
{% endif %}
{{ get_source_transform(col) }} = "DIM"."{{ col.name }}"
{% endfor %}
WHERE "DIM"."{{ get_value_by_column_attribute("isSystemCurrentFlag") }}" = 'Y'
{% for col in source.columns if (col.isChangeTracking == true) %}
{% if loop.first %}
AND (
{% else %}
OR
{% endif %}
( NVL( CAST({{ get_source_transform(col) }} as STRING), '**NULL**') <> NVL( CAST("DIM"."{{ col.name }}" as STRING), '**NULL**') )
{% if loop.last %}
)
{% endif %}
{% endfor %}
{# The if-block below avoids unnecessary updates when no type 2 column changes are present #}
{% if source.columns
| rejectattr('isSurrogateKey')
| rejectattr('isBusinessKey')
| rejectattr('isChangeTracking')
| rejectattr('isSystemVersion')
| rejectattr('isSystemCurrentFlag')
| rejectattr('isSystemStartDate')
| rejectattr('isSystemEndDate')
| rejectattr('isSystemCreateDate')
| rejectattr('isSystemUpdateDate')
| list | length == 0
%}
{# Skip Section #}
{% else %}
UNION ALL
/* Rows Needing To Be Updated Due To Changes To Non-Type-2 columns
This case merges only when there are changes in non-type-2 column updates, but no changes in type-2 columns*/
SELECT
{%- for col in source.columns if not col.isSurrogateKey %}
{% if col.isSystemVersion or col.isSystemCreateDate or col.isSystemStartDate or col.isSystemEndDate %}
"DIM"."{{ col.name }}"
{% elif col.isSystemCurrentFlag %}
'Y'
{% else %}
{{ get_source_transform(col) }}
{% endif %}
AS "{{ col.name }}",
{% endfor -%}
'UPDATE_NON_TYPE2_ROWS' AS "DML_OPERATION"
{{ source.join }}
INNER JOIN {{ ref_no_link(node.location.name, node.name) }} "DIM" ON
{% for col in source.columns if col.isBusinessKey -%}
{% if not loop.first %}
AND
{% endif %}
{{ get_source_transform(col) }} = "DIM"."{{ col.name }}"
{% endfor %}
WHERE "DIM"."{{ get_value_by_column_attribute("isSystemCurrentFlag") }}" = 'Y'
AND (
{% for col in source.columns if (col.isChangeTracking) -%}
{% if not loop.first %}
AND
{% endif %}
{{ get_source_transform(col) }} = "DIM"."{{ col.name }}"
{% endfor %} )
{% for col in source.columns if not ( col.isBusinessKey or
col.isChangeTracking or
col.isSurrogateKey or
col.isSystemVersion or
col.isSystemCurrentFlag or
col.isSystemStartDate or
col.isSystemEndDate or
col.isSystemUpdateDate or
col.isSystemCreateDate) -%}
{% if loop.first %}
AND (
{% endif %}
{% if not loop.first %}
OR
{% endif %}
NVL( CAST({{ get_source_transform(col) }} as STRING), '**NULL**') <> NVL( CAST("DIM"."{{ col.name }}" as STRING), '**NULL**')
{% if loop.last %}
)
{% endif %}
{% endfor %}
{% endif %}
) AS "SRC"
ON
{% for col in source.columns if col.isBusinessKey -%}
{% if not loop.first %}
AND
{% endif %}
"TGT"."{{ col.name }}" = "SRC"."{{ col.name }}"
{% endfor %}
AND "TGT"."{{ get_value_by_column_attribute("isSystemVersion") }}" = "SRC"."{{ get_value_by_column_attribute("isSystemVersion") }}"
WHEN MATCHED THEN UPDATE SET
{%- for col in source.columns if not (col.isBusinessKey or col.isSurrogateKey or col.isSystemCreateDate) %}
"TGT"."{{ col.name }}" = "SRC"."{{ col.name }}"
{% if not loop.last %}, {% endif %}
{% endfor -%}
WHEN NOT MATCHED THEN INSERT (
{%- for col in source.columns if not col.isSurrogateKey %}
"{{ col.name }}"
{% if not loop.last %}, {% endif %}
{% endfor -%}
)
VALUES (
{%- for col in source.columns if not col.isSurrogateKey %}
"SRC"."{{ col.name }}"
{% if not loop.last %}, {% endif %}
{% endfor -%}
)
{% endfor %}
{% else %}
{% for source in sources %}
{{ stage('MERGE ' + source.name | string ) }}
MERGE INTO {{ ref_no_link(node.location.name, node.name) }} "TGT"
USING (
SELECT
{% for col in source.columns if not col.isSurrogateKey %}
{% if col.isSystemVersion %}
1
{% elif col.isSystemCurrentFlag %}
'Y'
{% else %}
{{ get_source_transform(col) }}
{% endif %}
AS "{{ col.name }}"
{%- if not loop.last %}, {% endif %}
{% endfor %}
{{ source.join }})
AS "SRC"
ON
{% for col in source.columns if col.isBusinessKey -%}
{% if not loop.first %}
AND
{% endif %}
"SRC"."{{ col.name }}" = "TGT"."{{ col.name }}"
{% endfor %}
WHEN MATCHED
{% for col in source.columns if not ( col.isBusinessKey or
col.isSurrogateKey or
col.isSystemVersion or
col.isSystemCurrentFlag or
col.isSystemStartDate or
col.isSystemEndDate or
col.isSystemUpdateDate or
col.isSystemCreateDate) %}
{% if loop.first %}
AND (
{% else %}
OR
{% endif %}
NVL( CAST("SRC"."{{ col.name }}" as STRING), '**NULL**') <> NVL( CAST("TGT"."{{ col.name }}" as STRING), '**NULL**')
{% if loop.last %}
)
{% endif %}
{% endfor %}
THEN UPDATE SET
{%- for col in source.columns if not ( col.isBusinessKey or
col.isSurrogateKey or
col.isSystemVersion or
col.isSystemCurrentFlag or
col.isSystemStartDate or
col.isSystemEndDate or
col.isSystemCreateDate) %}
"TGT"."{{ col.name }}" = "SRC"."{{ col.name }}"
{% if not loop.last %}, {% endif %}
{% endfor %}
WHEN NOT MATCHED THEN
INSERT (
{%- for col in source.columns if not col.isSurrogateKey %}
"{{ col.name }}"
{% if not loop.last %}, {% endif %}
{% endfor -%}
)
VALUES (
{%- for col in source.columns if not col.isSurrogateKey %}
"SRC"."{{ col.name }}"
{% if not loop.last %}, {% endif %}
{% endfor -%}
)
{% endfor %}
{% endif %}
{% if config.postSQL %}
{{ stage('Post-SQL') }}
{{ config.postSQL }}
{% endif %}
{% endif %}
{% if config.testsEnabled %}
{% for test in node.tests %}
{% if test.runOrder == 'After' %}
{{ test_stage(test.name, test.continueOnFailure) }}
{{ test.templateString }}
{% endif %}
{% endfor %}
{% for column in columns %}
{% for test in column.tests %}
{{ test_stage(column.name + ": " + test.name) }}
{{ test.templateString }}
{% endfor %}
{% endfor %}
{% endif %}
PersistentStage-persistentStage
- create.sql.j2
- definition
- run.sql.j2
{% if node.materializationType == 'table' %}
{{ stage('Create Persistent Stage Table') }}
CREATE OR REPLACE TABLE {{ ref_no_link(node.location.name, node.name) }}
(
{% for col in columns %}
"{{ col.name }}" {{ col.dataType }}
{% if col.isSurrogateKey %}
identity
{% endif %}
{%- if not col.nullable %} NOT NULL
{%- if col.defaultValue | length > 0 %} DEFAULT {{ col.defaultValue }}{% endif %}
{% endif %}
{%- if col.description | length > 0 %} COMMENT '{{ col.description | escape }}'{% endif %}
{%- if not loop.last -%}, {% endif %}
{% endfor %}
)
{%- if node.description | length > 0 %} COMMENT = '{{ node.description | escape }}'{% endif %}
{% elif node.materializationType == 'view' %}
{{ stage('Create Persistent Stage View') }}
CREATE OR REPLACE VIEW {{ ref_no_link(node.location.name, node.name) }}
(
{% for col in columns %}
"{{ col.name }}"
{%- if col.description | length > 0 %} COMMENT '{{ col.description | escape }}'{% endif %}
{%- if not loop.last -%},{% endif %}
{% endfor %}
)
{%- if node.description | length > 0 %} COMMENT = '{{ node.description | escape }}'{% endif %}
AS
{% for source in sources %}
{% if not loop.last %} UNION ALL {% endif %}
{% endfor %}
{% for col in source.columns %}
{% if col.isSurrogateKey or col.isSystemUpdateDate or col.isSystemCreateDate %}
NULL
{% else %}
{{ get_source_transform(col) }}
{% endif %}
AS "{{ col.name }}"
{%- if not loop.last -%}, {% endif %}
{% endfor %}
{{ source.join }}
{% endif %}
fileVersion: 1
id: persistentStage
isDisabled: false
metadata:
defaultStorageLocation: null
error: null
nodeMetadataSpec: |
capitalized: Persistent Stage
short: PSTG
plural: Persistent Stages
tagColor: '#29B2DB'
config:
- groupName: Options
items:
- type: materializationSelector
isRequired: true
default: table
options:
- table
- view
- type: businessKeyColumns
isRequired: false
- type: multisourceToggle
enableIf: "{% if node.materializationType == 'table' %} true {% else %} false {% endif %}"
- type: overrideSQLToggle
enableIf: "{% if node.materializationType == 'view' %} true {% else %} false {% endif %}"
- displayName: Enable Tests
attributeName: testsEnabled
type: toggleButton
default: true
- displayName: Pre-SQL
attributeName: preSQL
type: textBox
syntax: sql
isRequired: false
- displayName: Post-SQL
attributeName: postSQL
type: textBox
syntax: sql
isRequired: false
systemColumns:
- displayName: '{{NODE_NAME}}_KEY'
transform: ''
dataType: NUMBER
placement: beginning
attributeName: isSurrogateKey
- displayName: SYSTEM_VERSION
transform: ''
dataType: NUMBER
placement: end
attributeName: isSystemVersion
- displayName: SYSTEM_CURRENT_FLAG
transform: ''
dataType: VARCHAR
placement: end
attributeName: isSystemCurrentFlag
- displayName: SYSTEM_START_DATE
transform: CAST(CURRENT_TIMESTAMP AS TIMESTAMP)
dataType: TIMESTAMP
placement: end
attributeName: isSystemStartDate
- displayName: SYSTEM_END_DATE
transform: CAST('2999-12-31 00:00:00' AS TIMESTAMP)
dataType: TIMESTAMP
placement: end
attributeName: isSystemEndDate
- displayName: SYSTEM_CREATE_DATE
transform: CAST(CURRENT_TIMESTAMP AS TIMESTAMP)
dataType: TIMESTAMP
placement: end
attributeName: isSystemCreateDate
- displayName: SYSTEM_UPDATE_DATE
transform: CAST(CURRENT_TIMESTAMP AS TIMESTAMP)
dataType: TIMESTAMP
placement: end
attributeName: isSystemUpdateDate
name: Persistent Stage
type: NodeType
{% set has_business_key = columns | selectattr("isBusinessKey") | list | length > 0 %}
{% set is_type_2 = columns | selectattr("isChangeTracking") | list | length > 0 %}
{% for test in node.tests if config.testsEnabled %}
{% if test.runOrder == 'Before' %}
{{ test_stage(test.name, test.continueOnFailure) }}
{{ test.templateString }}
{% endif %}
{% endfor %}
{% if node.materializationType == 'table' %}
{% if config.preSQL %}
{{ stage('Pre-SQL') }}
{{ config.preSQL }}
{% endif %}
{% if has_business_key and is_type_2 %}
{% for source in sources %}
{{ stage('MERGE ' + source.name | string) }}
MERGE INTO {{ ref_no_link(node.location.name, node.name) }} "TGT"
USING (
/* New Rows That Don't Exist */
SELECT
{% for col in source.columns if not col.isSurrogateKey %}
{% if col.isSystemVersion %}
1
{% elif col.isSystemCurrentFlag %}
'Y'
{% else %}
{{ get_source_transform(col) }}
{% endif %}
AS "{{ col.name }}",
{% endfor %}
'INSERT_INITAL_VERSION_ROWS' AS "DML_OPERATION"
{{ source.join }}
LEFT JOIN {{ ref_no_link(node.location.name, node.name) }} "DIM" ON
{% for col in source.columns if col.isBusinessKey -%}
{% if not loop.first %}
AND
{% endif %}
{{ get_source_transform(col) }} = "DIM"."{{ col.name }}"
{% endfor %}
WHERE
{% for col in source.columns if col.isBusinessKey -%}
{% if not loop.first %}
AND
{% endif %}
"DIM"."{{ col.name }}" IS NULL
{% endfor %}
UNION ALL
/* New Row Needing To Be Inserted Due To Type-2 Column Changes */
SELECT
{% for col in source.columns if not col.isSurrogateKey %}
{% if col.isSystemVersion %}
"DIM"."{{ col.name }}" + 1
{% elif col.isSystemCurrentFlag %}
'Y'
{% else %}
{{ get_source_transform(col) }}
{% endif %}
AS "{{ col.name }}",
{% endfor %}
'INSERT_NEW_VERSION_ROWS' AS "DML_OPERATION"
{{ source.join }}
INNER JOIN {{ ref_no_link(node.location.name, node.name) }} "DIM" ON
{% for col in source.columns if col.isBusinessKey -%}
{% if not loop.first %}
AND
{% endif %}
{{ get_source_transform(col) }} = "DIM"."{{ col.name }}"
{% endfor %}
WHERE "DIM"."{{ get_value_by_column_attribute("isSystemCurrentFlag") }}" = 'Y'
{% for col in source.columns if (col.isChangeTracking == true) %}
{% if loop.first %}
AND (
{% else %}
OR
{% endif %}
( NVL( CAST({{ get_source_transform(col) }} as STRING), '**NULL**') <> NVL( CAST("DIM"."{{ col.name }}" as STRING), '**NULL**') )
{% if loop.last %}
)
{% endif %}
{% endfor %}
UNION ALL
/* Rows Needing To Be Expired Due To Type-2 Column Changes
In this case, only two columns are merged (version and end date) */
SELECT
{%- for col in source.columns if not col.isSurrogateKey %}
{% if col.isSystemEndDate %}
DATEADD(MILLISECONDS, -1, CAST(CURRENT_TIMESTAMP AS TIMESTAMP))
{% elif col.isSystemCurrentFlag %}
'N'
{% else %}
"DIM"."{{ col.name }}"
{% endif %}
AS "{{ col.name }}",
{% endfor -%}
'update_expired_version_rows' AS "DML_OPERATION"
{{ source.join }}
INNER JOIN {{ ref_no_link(node.location.name, node.name) }} "DIM" ON
{% for col in source.columns if col.isBusinessKey -%}
{% if not loop.first %}
AND
{% endif %}
{{ get_source_transform(col) }} = "DIM"."{{ col.name }}"
{% endfor %}
WHERE "DIM"."{{ get_value_by_column_attribute("isSystemCurrentFlag") }}" = 'Y'
{% for col in source.columns if (col.isChangeTracking == true) %}
{% if loop.first %}
AND (
{% else %}
OR
{% endif %}
( NVL( CAST({{ get_source_transform(col) }} as STRING), '**NULL**') <> NVL( CAST("DIM"."{{ col.name }}" as STRING), '**NULL**') )
{% if loop.last %}
)
{% endif %}
{% endfor %}
UNION ALL
/* Rows Needing To Be Updated Due To Changes To Non-Type-2 source.columns
This case merges only when there are changes in non-type-2 column updates, but no changes in type-2 columns*/
SELECT
{%- for col in source.columns if not col.isSurrogateKey %}
{% if col.isSystemVersion or col.isSystemCreateDate or col.isSystemStartDate or col.isSystemEndDate %}
"DIM"."{{ col.name }}"
{% elif col.isSystemCurrentFlag %}
'Y'
{% else %}
{{ get_source_transform(col) }}
{% endif %}
AS "{{ col.name }}",
{% endfor -%}
'UPDATE_NON_TYPE2_ROWS' AS "DML_OPERATION"
{{ source.join }}
INNER JOIN {{ ref_no_link(node.location.name, node.name) }} "DIM" ON
{% for col in source.columns if col.isBusinessKey -%}
{% if not loop.first %}
AND
{% endif %}
{{ get_source_transform(col) }} = "DIM"."{{ col.name }}"
{% endfor %}
WHERE "DIM"."{{ get_value_by_column_attribute("isSystemCurrentFlag") }}" = 'Y'
AND (
{% for col in source.columns if (col.isChangeTracking) -%}
{% if not loop.first %}
AND
{% endif %}
{{ get_source_transform(col) }} = "DIM"."{{ col.name }}"
{% endfor %} )
{% for col in source.columns if not ( col.isBusinessKey or
col.isChangeTracking or
col.isSurrogateKey or
col.isSystemVersion or
col.isSystemCurrentFlag or
col.isSystemStartDate or
col.isSystemEndDate or
col.isSystemUpdateDate or
col.isSystemCreateDate) -%}
{% if loop.first %}
AND (
{% endif %}
{% if not loop.first %}
OR
{% endif %}
NVL( CAST({{ get_source_transform(col) }} as STRING), '**NULL**') <> NVL( CAST("DIM"."{{ col.name }}" as STRING), '**NULL**')
{% if loop.last %}
)
{% endif %}
{% endfor %}
) AS "SRC"
ON
{% for col in source.columns if col.isBusinessKey -%}
{% if not loop.first %}
AND
{% endif %}
"TGT"."{{ col.name }}" = "SRC"."{{ col.name }}"
{% endfor %}
AND "TGT"."{{ get_value_by_column_attribute("isSystemVersion") }}" = "SRC"."{{ get_value_by_column_attribute("isSystemVersion") }}"
WHEN MATCHED THEN UPDATE SET
{%- for col in source.columns if not (col.isBusinessKey or col.isSurrogateKey or col.isSystemCreateDate) %}
"TGT"."{{ col.name }}" = "SRC"."{{ col.name }}"
{% if not loop.last %}, {% endif %}
{% endfor -%}
WHEN NOT MATCHED THEN INSERT (
{%- for col in source.columns if not col.isSurrogateKey %}
"{{ col.name }}"
{% if not loop.last %}, {% endif %}
{% endfor -%}
)
VALUES (
{%- for col in source.columns if not col.isSurrogateKey %}
"SRC"."{{ col.name }}"
{% if not loop.last %}, {% endif %}
{% endfor -%}
)
{% endfor %}
{% elif has_business_key and not is_type_2 %}
{% for source in sources %}
{{ stage('MERGE ' + source.name | string ) }}
MERGE INTO {{ ref_no_link(node.location.name, node.name) }} "TGT"
USING (
SELECT
{% for col in source.columns if not col.isSurrogateKey %}
{% if col.isSystemVersion %}
1
{% elif col.isSystemCurrentFlag %}
'Y'
{% else %}
{{ get_source_transform(col) }}
{% endif %}
AS "{{ col.name }}"
{%- if not loop.last %}, {% endif %}
{% endfor %}
{{ source.join }})
AS "SRC"
ON
{% for col in source.columns if col.isBusinessKey -%}
{% if not loop.first %}
AND
{% endif %}
"SRC"."{{ col.name }}" = "TGT"."{{ col.name }}"
{% endfor %}
WHEN MATCHED
{% for col in source.columns if not ( col.isBusinessKey or
col.isSurrogateKey or
col.isSystemVersion or
col.isSystemCurrentFlag or
col.isSystemStartDate or
col.isSystemEndDate or
col.isSystemUpdateDate or
col.isSystemCreateDate) %}
{% if loop.first %}
AND (
{% else %}
OR
{% endif %}
NVL( CAST("SRC"."{{ col.name }}" as STRING), '**NULL**') <> NVL( CAST("TGT"."{{ col.name }}" as STRING), '**NULL**')
{% if loop.last %}
)
{% endif %}
{% endfor %}
THEN UPDATE SET
{%- for col in source.columns if not ( col.isBusinessKey or
col.isSurrogateKey or
col.isSystemVersion or
col.isSystemCurrentFlag or
col.isSystemStartDate or
col.isSystemEndDate or
col.isSystemCreateDate) %}
"TGT"."{{ col.name }}" = "SRC"."{{ col.name }}"
{% if not loop.last %}, {% endif %}
{% endfor %}
WHEN NOT MATCHED THEN
INSERT (
{%- for col in source.columns if not col.isSurrogateKey %}
"{{ col.name }}"
{% if not loop.last %}, {% endif %}
{% endfor -%}
)
VALUES (
{%- for col in source.columns if not col.isSurrogateKey %}
"SRC"."{{ col.name }}"
{% if not loop.last %}, {% endif %}
{% endfor -%}
)
{% endfor %}
{% else %}
{% for source in sources %}
{{ stage('Insert ' + source.name | string ) }}
INSERT INTO {{ ref_no_link(node.location.name, node.name) }}
(
{% for col in source.columns if not col.isSurrogateKey %}
"{{ col.name }}"
{%- if not loop.last -%},{% endif %}
{% endfor %}
)
SELECT
{% for col in source.columns if not col.isSurrogateKey %}
{% if col.isSystemVersion %}
1
{% elif col.isSystemCurrentFlag %}
'Y'
{% else %}
{{ get_source_transform(col) }}
{% endif %}
AS "{{ col.name }}"
{%- if not loop.last -%}, {% endif %}
{% endfor %}
{{ source.join }}
{% endfor %}
{% endif %}
{% if config.postSQL %}
{{ stage('Post-SQL') }}
{{ config.postSQL }}
{% endif %}
{% endif %}
{% if config.testsEnabled %}
{% for test in node.tests %}
{% if test.runOrder == 'After' %}
{{ test_stage(test.name, test.continueOnFailure) }}
{{ test.templateString }}
{% endif %}
{% endfor %}
{% for column in columns %}
{% for test in column.tests %}
{{ test_stage(column.name + ": " + test.name) }}
{{ test.templateString }}
{% endfor %}
{% endfor %}
{% endif %}
Stage-Stage
- create.sql.j2
- definition
- run.sql.j2
{% if node.override.create.enabled %}
{{ node.override.create.script }}
{% elif node.materializationType == 'table' %}
{{ stage('Create Stage Table') }}
CREATE OR REPLACE TABLE {{ ref_no_link(node.location.name, node.name) }}
(
{% for col in columns %}
"{{ col.name }}" {{ col.dataType }}
{%- if not col.nullable %} NOT NULL
{%- if col.defaultValue | length > 0 %} DEFAULT {{ col.defaultValue }}{% endif %}
{% endif %}
{%- if col.description | length > 0 %} COMMENT '{{ col.description | escape }}'{% endif %}
{%- if not loop.last -%}, {% endif %}
{% endfor %}
)
{%- if node.description | length > 0 %} COMMENT = '{{ node.description | escape }}'{% endif %}
{% elif node.materializationType == 'view' %}
{{ stage('Create Stage View') }}
CREATE OR REPLACE VIEW {{ ref_no_link(node.location.name, node.name) }}
(
{% for col in columns %}
"{{ col.name }}"
{%- if col.description | length > 0 %} COMMENT '{{ col.description | escape }}'{% endif %}
{%- if not loop.last -%}, {% endif %}
{% endfor %}
)
{%- if node.description | length > 0 %} COMMENT = '{{ node.description | escape }}'{% endif %}
AS
{% for source in sources %}
SELECT
{% for col in source.columns %}
{{ get_source_transform(col) }} AS "{{ col.name }}"
{%- if not loop.last -%}, {% endif %}
{% endfor %}
{{ source.join }}
{% if not loop.last %}
{% if config.insertStrategy in ['UNION', 'UNION ALL'] %}
{{ config.insertStrategy }}
{% else %}
UNION
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
fileVersion: 1
id: Stage
isDisabled: false
metadata:
defaultStorageLocation: null
error: null
nodeMetadataSpec: |
capitalized: Stage
short: STG
plural: Stages
tagColor: '#2EB67D'
config:
- groupName: Options
items:
- type: materializationSelector
default: table
options:
- table
- view
isRequired: true
- type: multisourceToggle
enableIf: "{% if node.materializationType == 'table' %} true {% else %} false {% endif %}"
- type: overrideSQLToggle
enableIf: "{% if node.materializationType == 'view' %} true {% else %} false {% endif %}"
- displayName: Multi Source Strategy
attributeName: insertStrategy
type: dropdownSelector
default: INSERT
options:
- "INSERT"
- "UNION"
- "UNION ALL"
isRequired: true
enableIf: "{% if node.isMultisource %} true {% else %} false {% endif %}"
- displayName: Truncate Before
attributeName: truncateBefore
type: toggleButton
default: true
- displayName: Enable Tests
attributeName: testsEnabled
type: toggleButton
default: true
- displayName: Pre-SQL
attributeName: preSQL
type: textBox
syntax: sql
isRequired: false
- displayName: Post-SQL
attributeName: postSQL
type: textBox
syntax: sql
isRequired: false
name: Stage
type: NodeType
{% for test in node.tests if config.testsEnabled %}
{% if test.runOrder == 'Before' %}
{{ test_stage(test.name, test.continueOnFailure) }}
{{ test.templateString }}
{% endif %}
{% endfor %}
{% if node.materializationType == 'table' %}
{% if config.preSQL %}
{{ stage('Pre-SQL') }}
{{ config.preSQL }}
{% endif %}
{% if config.truncateBefore %}
{{ stage('Truncate Stage Table') }}
TRUNCATE IF EXISTS {{ ref_no_link(node.location.name, node.name) }}
{% endif %}
{% if config.insertStrategy in ['UNION', 'UNION ALL'] %}
{{ stage( config.insertStrategy + ' Sources' | string ) }}
INSERT INTO {{ ref_no_link(node.location.name, node.name) }}
(
{% for col in columns %}
"{{ col.name }}"
{%- if not loop.last -%},{% endif %}
{% endfor %}
)
{% endif %}
{% for source in sources %}
{% if config.insertStrategy == 'INSERT' %}
{{ stage('Insert ' + source.name | string ) }}
INSERT INTO {{ ref_no_link(node.location.name, node.name) }}
(
{% for col in source.columns %}
"{{ col.name }}"
{%- if not loop.last -%},{% endif %}
{% endfor %}
)
{% endif %}
SELECT
{% for col in source.columns %}
{{ get_source_transform(col) }} AS "{{ col.name }}"
{%- if not loop.last -%}, {% endif %}
{% endfor %}
{{ source.join }}
{% if config.insertStrategy in ['UNION', 'UNION ALL'] and not loop.last %}
{{config.insertStrategy}}
{% endif %}
{% endfor %}
{% if config.postSQL %}
{{ stage('Post-SQL') }}
{{ config.postSQL }}
{% endif %}
{% endif %}
{% if config.testsEnabled %}
{% for test in node.tests %}
{% if test.runOrder == 'After' %}
{{ test_stage(test.name, test.continueOnFailure) }}
{{ test.templateString }}
{% endif %}
{% endfor %}
{% for column in columns %}
{% for test in column.tests %}
{{ test_stage(column.name + ": " + test.name) }}
{{ test.templateString }}
{% endfor %}
{% endfor %}
{% endif %}
View-View
- create.sql.j2
- definition
- run.sql.j2
{% if node.override.create.enabled %}
{{ node.override.create.script }}
{% else %}
{{ stage('Create View') }}
CREATE OR REPLACE VIEW {{ ref_no_link(node.location.name, node.name) }}
(
{% for col in columns %}
"{{ col.name }}"
{%- if col.description | length > 0 %} COMMENT '{{ col.description | escape }}'{% endif %}
{%- if not loop.last -%}, {% endif %}
{% endfor %}
)
{%- if node.description | length > 0 %} COMMENT = '{{ node.description | escape }}'{% endif %}
AS
{% for source in sources %}
SELECT {% if config.selectDistinct %} DISTINCT {% endif %}
{% for col in source.columns %}
{{ get_source_transform(col) }} AS "{{ col.name }}"
{%- if not loop.last -%}, {% endif %}
{% endfor %}
{{ source.join }}
{% if not loop.last %}
{% if config.insertStrategy in ['UNION', 'UNION ALL'] %}
{{ config.insertStrategy }}
{% else %}
UNION
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
fileVersion: 1
id: View
isDisabled: true
metadata:
defaultStorageLocation: null
error: null
nodeMetadataSpec: |
capitalized: View
short: V
tagColor: '#C4C4C4'
isDisabled: true
plural: Views
config:
- groupName: Options
items:
- type: materializationSelector
options:
- view
default: view
isRequired: true
- type: toggleButton
attributeName: selectDistinct
displayName: Distinct
- type: multisourceToggle
- type: overrideSQLToggle
- displayName: Multi Source Strategy
attributeName: insertStrategy
type: dropdownSelector
default: UNION
options:
- "UNION"
- "UNION ALL"
isRequired: true
enableIf: "{% if node.isMultisource %} true {% else %} false {% endif %}"
name: View
type: NodeType
empty
Packages
Package contents can vary. Learn more about Coalesce Packages.
Packages Example
config:
entities:
nodeTypes:
"25":
defaultStorageLocation: null
isDisabled: false
"35":
defaultStorageLocation: null
isDisabled: false
"36":
defaultStorageLocation: null
isDisabled: false
"37":
defaultStorageLocation: null
isDisabled: false
"38":
defaultStorageLocation: null
isDisabled: false
packageVariables: |-
{%- set demopkg4coalesce = namespace(
config = {
"ldts_alias": "LDTS",
"rsrc_alias": "RSRC",
"ledts_alias": "LEDTS",
"stg_alias": "STG",
"snapshot_trigger_column": "IS_ACTIVE",
"use_object_name_prefix": TRUE,
"sdts_alias": "SDTS",
"is_current_col_alias": "IS_CURRENT",
"hash": "MD5",
"hash_datatype": "STRING",
"hash_input_case_sensitive": "TRUE",
"hash_passthrough_input_transformations": "TRUE",
"beginning_of_all_times": "0001-01-01T00:00:01",
"end_of_all_times": "8888-12-31T23:59:59",
"timestamp_format": "YYYY-MM-DDTHH24:MI:SS",
"default_unknown_rsrc": "SYSTEM",
"default_error_rsrc": "ERROR",
"rsrc_default_dtype": "STRING",
"stg_default_dtype": "STRING",
"error_value__STRING": "'(error)'",
"error_value_alt__STRING": "'e'",
"unknown_value__STRING": "'(unknown)'",
"unknown_value_alt__STRING": "'u'"
}
) -%}
fileVersion: 1
id: "@coalesce/support-demo-pkg"
name: secondPackage
packageID: "@coalesce/support-demo-pkg"
releaseID: d1ea23de-1b86-478d-916a-d8bc9f06ba41
type: Package
data.yml
defaultStorageMapping: SAMPLE
fileVersion: 3
locations.yml
A list of storage locations and the default location.
defaultStorageMapping: SAMPLE
fileVersion: 1
locations:
- HELLO
- SAMPLE
- WORK