ingestron 0.17.8 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +3 -5
- package/README.md +26 -74
- package/THIRD_PARTY_NOTICES +148 -0
- package/dist/main.js +29708 -0
- package/package.json +32 -65
- package/project-templates/kafka/README.md +12 -0
- package/project-templates/kafka/connections/events.yaml +8 -0
- package/project-templates/kafka/contracts/page_views.yaml +13 -0
- package/project-templates/kafka/contracts/purchases.yaml +13 -0
- package/project-templates/kafka/flows/events.yaml +10 -0
- package/project-templates/kafka/project.yaml +10 -0
- package/project-templates/kafka/standard.yaml +4 -0
- package/project-templates/kafka/template.yaml +3 -0
- package/project-templates/minimal/README.md +10 -0
- package/project-templates/minimal/connections/shop.yaml +7 -0
- package/project-templates/minimal/contracts/orders.yaml +14 -0
- package/project-templates/minimal/flows/orders.yaml +6 -0
- package/project-templates/minimal/project.yaml +11 -0
- package/project-templates/minimal/standard.yaml +4 -0
- package/project-templates/minimal/template.yaml +7 -0
- package/project-templates/private-files/README.md +29 -0
- package/project-templates/private-files/connections/share.yaml +10 -0
- package/project-templates/private-files/contracts/sales.yaml +14 -0
- package/project-templates/private-files/contracts/stock.yaml +14 -0
- package/project-templates/private-files/flows/stores.yaml +9 -0
- package/project-templates/private-files/platform.yaml +11 -0
- package/project-templates/private-files/project.yaml +19 -0
- package/project-templates/private-files/standard.yaml +11 -0
- package/project-templates/private-files/template.yaml +10 -0
- package/project-templates/private-sql-server/README.md +25 -0
- package/project-templates/private-sql-server/connections/erp.yaml +10 -0
- package/project-templates/private-sql-server/contracts/customers.yaml +14 -0
- package/project-templates/private-sql-server/contracts/invoices.yaml +15 -0
- package/project-templates/private-sql-server/flows/erp.yaml +13 -0
- package/project-templates/private-sql-server/platform.yaml +11 -0
- package/project-templates/private-sql-server/project.yaml +19 -0
- package/project-templates/private-sql-server/standard.yaml +17 -0
- package/project-templates/private-sql-server/template.yaml +10 -0
- package/project-templates/pyspark/README.md +12 -0
- package/project-templates/pyspark/connections/billing.yaml +7 -0
- package/project-templates/pyspark/contracts/invoices.yaml +16 -0
- package/project-templates/pyspark/contracts/monthly_revenue.yaml +14 -0
- package/project-templates/pyspark/flows/billing.yaml +6 -0
- package/project-templates/pyspark/project.yaml +11 -0
- package/project-templates/pyspark/standard.yaml +4 -0
- package/project-templates/pyspark/template.yaml +3 -0
- package/project-templates/pyspark/transforms/monthly_revenue.py +10 -0
- package/project-templates/pyspark/transforms/monthly_revenue.yaml +10 -0
- package/project-templates/retail/README.md +22 -0
- package/project-templates/retail/connections/shop.yaml +8 -0
- package/project-templates/retail/contracts/customers.yaml +12 -0
- package/project-templates/retail/contracts/daily_sales.yaml +19 -0
- package/project-templates/retail/contracts/orders.yaml +16 -0
- package/project-templates/retail/flows/shop.yaml +18 -0
- package/project-templates/retail/platform.yaml +21 -0
- package/project-templates/retail/project.yaml +18 -0
- package/project-templates/retail/standard.yaml +15 -0
- package/project-templates/retail/template.yaml +10 -0
- package/project-templates/retail/transforms/daily_sales.sql +7 -0
- package/project-templates/retail/transforms/daily_sales.yaml +7 -0
- package/project-templates/salesforce/README.md +6 -0
- package/project-templates/salesforce/connections/salesforce.yaml +7 -0
- package/project-templates/salesforce/contracts/accounts.yaml +13 -0
- package/project-templates/salesforce/contracts/opportunities.yaml +14 -0
- package/project-templates/salesforce/flows/salesforce.yaml +7 -0
- package/project-templates/salesforce/project.yaml +9 -0
- package/project-templates/salesforce/standard.yaml +4 -0
- package/project-templates/salesforce/template.yaml +3 -0
- package/project-templates/sql-server/README.md +17 -0
- package/project-templates/sql-server/connections/erp.yaml +8 -0
- package/project-templates/sql-server/contracts/customer_balances.yaml +13 -0
- package/project-templates/sql-server/contracts/customers.yaml +13 -0
- package/project-templates/sql-server/contracts/invoices.yaml +14 -0
- package/project-templates/sql-server/flows/erp.yaml +13 -0
- package/project-templates/sql-server/platform.yaml +6 -0
- package/project-templates/sql-server/project.yaml +13 -0
- package/project-templates/sql-server/standard.yaml +9 -0
- package/project-templates/sql-server/template.yaml +3 -0
- package/project-templates/sql-server/transforms/customer_balances.sql +5 -0
- package/project-templates/sql-server/transforms/customer_balances.yaml +6 -0
- package/recipes/connections/adls-gen2.yaml +7 -0
- package/recipes/connections/amazon-rds-oracle.yaml +9 -0
- package/recipes/connections/amazon-rds-sqlserver.yaml +9 -0
- package/recipes/connections/amazon-redshift.yaml +10 -0
- package/recipes/connections/amazon-s3.yaml +8 -0
- package/recipes/connections/azure-blob.yaml +7 -0
- package/recipes/connections/azure-cosmos-db-mongodb.yaml +8 -0
- package/recipes/connections/azure-cosmos-db-nosql.yaml +8 -0
- package/recipes/connections/azure-cosmos-postgresql.yaml +10 -0
- package/recipes/connections/azure-data-explorer.yaml +8 -0
- package/recipes/connections/azure-databricks-delta.yaml +9 -0
- package/recipes/connections/azure-files.yaml +8 -0
- package/recipes/connections/azure-mysql.yaml +7 -0
- package/recipes/connections/azure-postgresql.yaml +10 -0
- package/recipes/connections/azure-sql-database.yaml +9 -0
- package/recipes/connections/azure-sql-managed-instance.yaml +9 -0
- package/recipes/connections/azure-synapse.yaml +9 -0
- package/recipes/connections/azure-table-storage.yaml +7 -0
- package/recipes/connections/cassandra.yaml +9 -0
- package/recipes/connections/dataverse.yaml +9 -0
- package/recipes/connections/db2.yaml +7 -0
- package/recipes/connections/dynamics-365.yaml +9 -0
- package/recipes/connections/dynamics-ax.yaml +11 -0
- package/recipes/connections/dynamics-crm.yaml +9 -0
- package/recipes/connections/fabric-lakehouse.yaml +8 -0
- package/recipes/connections/fabric-warehouse.yaml +9 -0
- package/recipes/connections/files.yaml +9 -0
- package/recipes/connections/ftp.yaml +9 -0
- package/recipes/connections/google-ads.yaml +12 -0
- package/recipes/connections/google-bigquery.yaml +8 -0
- package/recipes/connections/google-cloud-storage.yaml +8 -0
- package/recipes/connections/greenplum.yaml +10 -0
- package/recipes/connections/hdfs.yaml +9 -0
- package/recipes/connections/hive.yaml +11 -0
- package/recipes/connections/http.yaml +7 -0
- package/recipes/connections/hubspot.yaml +10 -0
- package/recipes/connections/impala.yaml +11 -0
- package/recipes/connections/informix.yaml +9 -0
- package/recipes/connections/jira.yaml +9 -0
- package/recipes/connections/mariadb.yaml +10 -0
- package/recipes/connections/microsoft-365.yaml +10 -0
- package/recipes/connections/microsoft-access.yaml +9 -0
- package/recipes/connections/mongodb-atlas.yaml +8 -0
- package/recipes/connections/mongodb.yaml +8 -0
- package/recipes/connections/mysql.yaml +10 -0
- package/recipes/connections/netezza.yaml +11 -0
- package/recipes/connections/odata.yaml +9 -0
- package/recipes/connections/odbc.yaml +9 -0
- package/recipes/connections/oracle-cloud-storage.yaml +9 -0
- package/recipes/connections/oracle.yaml +9 -0
- package/recipes/connections/postgresql.yaml +10 -0
- package/recipes/connections/presto.yaml +11 -0
- package/recipes/connections/quickbooks.yaml +10 -0
- package/recipes/connections/rest.yaml +12 -0
- package/recipes/connections/s3-compatible.yaml +9 -0
- package/recipes/connections/salesforce-service-cloud.yaml +10 -0
- package/recipes/connections/salesforce.yaml +10 -0
- package/recipes/connections/sap-bw-mdx.yaml +11 -0
- package/recipes/connections/sap-bw-open-hub.yaml +11 -0
- package/recipes/connections/sap-c4c.yaml +9 -0
- package/recipes/connections/sap-ecc.yaml +9 -0
- package/recipes/connections/sap-hana.yaml +7 -0
- package/recipes/connections/sap-table.yaml +11 -0
- package/recipes/connections/servicenow.yaml +9 -0
- package/recipes/connections/sftp.yaml +10 -0
- package/recipes/connections/sharepoint-online-list.yaml +10 -0
- package/recipes/connections/shopify.yaml +8 -0
- package/recipes/connections/snowflake.yaml +11 -0
- package/recipes/connections/spark.yaml +11 -0
- package/recipes/connections/sqlserver.yaml +9 -0
- package/recipes/connections/square.yaml +10 -0
- package/recipes/connections/sybase.yaml +10 -0
- package/recipes/connections/teradata.yaml +9 -0
- package/recipes/connections/vertica.yaml +10 -0
- package/recipes/connections/web-table.yaml +7 -0
- package/recipes/connections/xero.yaml +10 -0
- package/recipes/contracts/records.yaml +12 -0
- package/recipes/contracts/salesforce-account.yaml +12 -0
- package/recipes/flows/adls-gen2.yaml +14 -0
- package/recipes/flows/amazon-rds-oracle.yaml +12 -0
- package/recipes/flows/amazon-rds-sqlserver.yaml +12 -0
- package/recipes/flows/amazon-redshift.yaml +12 -0
- package/recipes/flows/amazon-s3.yaml +14 -0
- package/recipes/flows/azure-blob.yaml +14 -0
- package/recipes/flows/azure-cosmos-db-mongodb.yaml +12 -0
- package/recipes/flows/azure-cosmos-db-nosql.yaml +12 -0
- package/recipes/flows/azure-cosmos-postgresql.yaml +12 -0
- package/recipes/flows/azure-data-explorer.yaml +13 -0
- package/recipes/flows/azure-databricks-delta.yaml +15 -0
- package/recipes/flows/azure-files.yaml +14 -0
- package/recipes/flows/azure-mysql.yaml +12 -0
- package/recipes/flows/azure-postgresql.yaml +12 -0
- package/recipes/flows/azure-sql-database.yaml +12 -0
- package/recipes/flows/azure-sql-managed-instance.yaml +12 -0
- package/recipes/flows/azure-synapse.yaml +12 -0
- package/recipes/flows/azure-table-storage.yaml +12 -0
- package/recipes/flows/cassandra.yaml +12 -0
- package/recipes/flows/dataverse.yaml +12 -0
- package/recipes/flows/db2.yaml +12 -0
- package/recipes/flows/dynamics-365.yaml +12 -0
- package/recipes/flows/dynamics-ax.yaml +12 -0
- package/recipes/flows/dynamics-crm.yaml +12 -0
- package/recipes/flows/fabric-lakehouse.yaml +14 -0
- package/recipes/flows/fabric-warehouse.yaml +14 -0
- package/recipes/flows/files.yaml +14 -0
- package/recipes/flows/ftp.yaml +14 -0
- package/recipes/flows/google-ads.yaml +13 -0
- package/recipes/flows/google-bigquery.yaml +12 -0
- package/recipes/flows/google-cloud-storage.yaml +14 -0
- package/recipes/flows/greenplum.yaml +12 -0
- package/recipes/flows/hdfs.yaml +14 -0
- package/recipes/flows/hive.yaml +12 -0
- package/recipes/flows/http.yaml +18 -0
- package/recipes/flows/hubspot.yaml +12 -0
- package/recipes/flows/impala.yaml +12 -0
- package/recipes/flows/informix.yaml +13 -0
- package/recipes/flows/jira.yaml +12 -0
- package/recipes/flows/mariadb.yaml +13 -0
- package/recipes/flows/microsoft-365.yaml +19 -0
- package/recipes/flows/microsoft-access.yaml +13 -0
- package/recipes/flows/mongodb-atlas.yaml +12 -0
- package/recipes/flows/mongodb.yaml +12 -0
- package/recipes/flows/mysql.yaml +12 -0
- package/recipes/flows/netezza.yaml +13 -0
- package/recipes/flows/odata.yaml +12 -0
- package/recipes/flows/odbc.yaml +13 -0
- package/recipes/flows/oracle-cloud-storage.yaml +14 -0
- package/recipes/flows/oracle.yaml +12 -0
- package/recipes/flows/postgresql.yaml +18 -0
- package/recipes/flows/presto.yaml +12 -0
- package/recipes/flows/quickbooks.yaml +12 -0
- package/recipes/flows/rest.yaml +21 -0
- package/recipes/flows/s3-compatible.yaml +14 -0
- package/recipes/flows/salesforce-service-cloud.yaml +12 -0
- package/recipes/flows/salesforce.yaml +13 -0
- package/recipes/flows/sap-bw-mdx.yaml +14 -0
- package/recipes/flows/sap-bw-open-hub.yaml +13 -0
- package/recipes/flows/sap-c4c.yaml +12 -0
- package/recipes/flows/sap-ecc.yaml +13 -0
- package/recipes/flows/sap-hana.yaml +14 -0
- package/recipes/flows/sap-table.yaml +13 -0
- package/recipes/flows/servicenow.yaml +12 -0
- package/recipes/flows/sftp.yaml +14 -0
- package/recipes/flows/sharepoint-online-list.yaml +12 -0
- package/recipes/flows/shopify.yaml +12 -0
- package/recipes/flows/snowflake.yaml +15 -0
- package/recipes/flows/spark.yaml +12 -0
- package/recipes/flows/sqlserver.yaml +12 -0
- package/recipes/flows/square.yaml +13 -0
- package/recipes/flows/sybase.yaml +13 -0
- package/recipes/flows/teradata.yaml +12 -0
- package/recipes/flows/vertica.yaml +12 -0
- package/recipes/flows/web-table.yaml +14 -0
- package/recipes/flows/xero.yaml +12 -0
- package/recipes/platform.yaml +29 -0
- package/recipes/project.yaml +10 -0
- package/recipes/sample.yaml +3 -0
- package/recipes/standard.yaml +15 -0
- package/schemas/NOTICE.md +7 -0
- package/schemas/connection.schema.yaml +37 -0
- package/schemas/flow.schema.yaml +125 -0
- package/schemas/odcs-v3.1.0.schema.json +2808 -0
- package/schemas/platform.schema.yaml +260 -0
- package/schemas/standard.schema.yaml +211 -0
- package/schemas/transform.schema.yaml +108 -0
- package/templates/apply-contract.py.liquid +58 -0
- package/templates/change-data.sql.liquid +20 -0
- package/templates/materialised-view.py.liquid +28 -0
- package/templates/materialised-view.sql.liquid +4 -0
- package/templates/read-files.liquid +7 -0
- package/templates/streaming-table.sql.liquid +3 -0
- package/templates/table.liquid +17 -0
- package/CHANGELOG.md +0 -162
- package/SECURITY.md +0 -32
- package/THIRD_PARTY_NOTICES.md +0 -3678
- package/build/cli/cli/index.d.ts +0 -2
- package/build/cli/cli/index.js +0 -685
- package/build/cli/cli/operation-worker.d.ts +0 -1
- package/build/cli/cli/operation-worker.js +0 -5
- package/build/cli/cli/output.d.ts +0 -3
- package/build/cli/cli/output.js +0 -246
- package/build/cli/cli/plugin-browser.d.ts +0 -14
- package/build/cli/cli/plugin-browser.js +0 -74
- package/build/cli/cli/plugin-resolution.d.ts +0 -126
- package/build/cli/cli/plugin-resolution.js +0 -270
- package/build/cli/cli/presentation.d.ts +0 -12
- package/build/cli/cli/presentation.js +0 -57
- package/build/cli/cli/workflow-commands.d.ts +0 -15
- package/build/cli/cli/workflow-commands.js +0 -430
- package/build/cli/mcp/index.d.ts +0 -3
- package/build/cli/mcp/index.js +0 -67
- package/build/cli/version.d.ts +0 -2
- package/build/cli/version.js +0 -14
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
|
2
|
+
title: Platform
|
|
3
|
+
description: >-
|
|
4
|
+
Where this project's assets go. Usually differs per environment through `${values.…}`. Optional:
|
|
5
|
+
without it, the pack's defaults apply.
|
|
6
|
+
type: object
|
|
7
|
+
additionalProperties: false
|
|
8
|
+
required: [apiVersion, kind, id]
|
|
9
|
+
properties:
|
|
10
|
+
apiVersion: { const: ingestron.io/v1, description: Always ingestron.io/v1. }
|
|
11
|
+
kind: { const: Platform, description: The document kind. }
|
|
12
|
+
id:
|
|
13
|
+
{
|
|
14
|
+
type: string,
|
|
15
|
+
pattern: "^[a-z][a-z0-9_-]*$",
|
|
16
|
+
description: "The platform's id: lowercase letters, digits, underscores and hyphens.",
|
|
17
|
+
examples: [lakehouse],
|
|
18
|
+
}
|
|
19
|
+
description:
|
|
20
|
+
{
|
|
21
|
+
type: string,
|
|
22
|
+
description: "What this document is for, in a sentence.",
|
|
23
|
+
examples: [Where the sales project's assets go.],
|
|
24
|
+
}
|
|
25
|
+
workspace:
|
|
26
|
+
type: object
|
|
27
|
+
additionalProperties: false
|
|
28
|
+
properties:
|
|
29
|
+
host:
|
|
30
|
+
{
|
|
31
|
+
type: string,
|
|
32
|
+
description: "Workspace URL. Leave out to use the deploying user's profile.",
|
|
33
|
+
examples: [https://adb-1111111111111111.1.azuredatabricks.net],
|
|
34
|
+
}
|
|
35
|
+
root_path:
|
|
36
|
+
{
|
|
37
|
+
type: string,
|
|
38
|
+
description: Folder in the workspace for deployed files.,
|
|
39
|
+
examples: [/Workspace/Shared/.bundle/sales],
|
|
40
|
+
}
|
|
41
|
+
description: The Databricks workspace host and root path.
|
|
42
|
+
mode:
|
|
43
|
+
enum: [development, production]
|
|
44
|
+
description: "Default: production for environments named prod or production, otherwise development."
|
|
45
|
+
enumDescriptions:
|
|
46
|
+
- "A copy for development: names carry the deploying user and schedules are paused."
|
|
47
|
+
- The shared resources, as they run in production.
|
|
48
|
+
run_as:
|
|
49
|
+
type: object
|
|
50
|
+
additionalProperties: false
|
|
51
|
+
minProperties: 1
|
|
52
|
+
maxProperties: 1
|
|
53
|
+
properties:
|
|
54
|
+
service_principal_name:
|
|
55
|
+
{
|
|
56
|
+
type: string,
|
|
57
|
+
description: Application id of the service principal the pipelines and jobs run as.,
|
|
58
|
+
examples: [7f3c2a10-0000-4000-8000-000000000001],
|
|
59
|
+
}
|
|
60
|
+
user_name:
|
|
61
|
+
{
|
|
62
|
+
type: string,
|
|
63
|
+
description: The user the pipelines and jobs run as.,
|
|
64
|
+
examples: [ingest@example.com],
|
|
65
|
+
}
|
|
66
|
+
description: The identity the pipelines and jobs run as.
|
|
67
|
+
compute:
|
|
68
|
+
type: object
|
|
69
|
+
additionalProperties: false
|
|
70
|
+
properties:
|
|
71
|
+
serverless: { type: boolean, description: "Default: true." }
|
|
72
|
+
budget_policy_id:
|
|
73
|
+
{
|
|
74
|
+
type: string,
|
|
75
|
+
description: Serverless budget policy that pipelines are charged to.,
|
|
76
|
+
examples: [5b1e3f2a-0000-4000-8000-000000000002],
|
|
77
|
+
}
|
|
78
|
+
channel:
|
|
79
|
+
{
|
|
80
|
+
enum: [CURRENT, PREVIEW],
|
|
81
|
+
description: "Lakeflow pipeline channel: CURRENT or PREVIEW.",
|
|
82
|
+
enumDescriptions:
|
|
83
|
+
[
|
|
84
|
+
"The current Lakeflow runtime, for production.",
|
|
85
|
+
"The next runtime, to try upcoming changes; some connectors need it.",
|
|
86
|
+
],
|
|
87
|
+
}
|
|
88
|
+
description: Serverless or classic compute, budget policy and channel.
|
|
89
|
+
settings:
|
|
90
|
+
type: object
|
|
91
|
+
additionalProperties: { type: object }
|
|
92
|
+
description: >-
|
|
93
|
+
Method settings for this platform, by method, over the standard's: where shared infrastructure
|
|
94
|
+
such as landing storage is, usually through `${values.…}`.
|
|
95
|
+
examples: [{ adf-files: { landing: "${values.landing}", key_vault: "${values.key_vault}" } }]
|
|
96
|
+
naming:
|
|
97
|
+
type: object
|
|
98
|
+
additionalProperties: false
|
|
99
|
+
description: Name patterns for this project, over the standard's.
|
|
100
|
+
properties:
|
|
101
|
+
catalog:
|
|
102
|
+
{
|
|
103
|
+
type: string,
|
|
104
|
+
description: "Name pattern for the catalog. Default: `the standard's`.",
|
|
105
|
+
examples: ["sales_{{ environment }}"],
|
|
106
|
+
}
|
|
107
|
+
schema:
|
|
108
|
+
{
|
|
109
|
+
type: string,
|
|
110
|
+
description: "Name pattern for the schema. Default: `the standard's`.",
|
|
111
|
+
examples: ["{{ layer }}"],
|
|
112
|
+
}
|
|
113
|
+
table:
|
|
114
|
+
{
|
|
115
|
+
type: string,
|
|
116
|
+
description: "Name pattern for the table. Default: `the standard's`.",
|
|
117
|
+
examples: ["{{ table }}"],
|
|
118
|
+
}
|
|
119
|
+
pipeline:
|
|
120
|
+
{
|
|
121
|
+
type: string,
|
|
122
|
+
description: "Name pattern for the pipeline. Default: `the standard's`.",
|
|
123
|
+
examples: ["{{ project }}"],
|
|
124
|
+
}
|
|
125
|
+
job:
|
|
126
|
+
{
|
|
127
|
+
type: string,
|
|
128
|
+
description: "Name pattern for the refresh job. Default: `the standard's`.",
|
|
129
|
+
examples: ["{{ project }}_refresh"],
|
|
130
|
+
}
|
|
131
|
+
tags:
|
|
132
|
+
{
|
|
133
|
+
type: object,
|
|
134
|
+
additionalProperties: { type: string },
|
|
135
|
+
description: Tags added to pipelines and jobs.,
|
|
136
|
+
}
|
|
137
|
+
permissions:
|
|
138
|
+
type: array
|
|
139
|
+
items:
|
|
140
|
+
type: object
|
|
141
|
+
additionalProperties: false
|
|
142
|
+
required: [level]
|
|
143
|
+
minProperties: 2
|
|
144
|
+
maxProperties: 2
|
|
145
|
+
properties:
|
|
146
|
+
level:
|
|
147
|
+
{
|
|
148
|
+
enum: [CAN_VIEW, CAN_RUN, CAN_MANAGE],
|
|
149
|
+
description: "CAN_VIEW, CAN_RUN or CAN_MANAGE.",
|
|
150
|
+
enumDescriptions:
|
|
151
|
+
[
|
|
152
|
+
See the pipelines and jobs and their runs.,
|
|
153
|
+
Also start and stop runs.,
|
|
154
|
+
"Also change and delete them, and their permissions.",
|
|
155
|
+
],
|
|
156
|
+
}
|
|
157
|
+
group_name:
|
|
158
|
+
{
|
|
159
|
+
type: string,
|
|
160
|
+
description: "A group, or use user_name or service_principal_name instead.",
|
|
161
|
+
examples: [data-engineers],
|
|
162
|
+
}
|
|
163
|
+
user_name:
|
|
164
|
+
{
|
|
165
|
+
type: string,
|
|
166
|
+
description: "A user, or use group_name or service_principal_name instead.",
|
|
167
|
+
examples: [ana@example.com],
|
|
168
|
+
}
|
|
169
|
+
service_principal_name:
|
|
170
|
+
{
|
|
171
|
+
type: string,
|
|
172
|
+
description: "A service principal's application id, or use group_name or user_name instead.",
|
|
173
|
+
examples: [7f3c2a10-0000-4000-8000-000000000001],
|
|
174
|
+
}
|
|
175
|
+
description: Who can view, run or manage the bundle's resources.
|
|
176
|
+
examples:
|
|
177
|
+
- - group_name: data-engineers
|
|
178
|
+
level: CAN_MANAGE
|
|
179
|
+
- group_name: analysts
|
|
180
|
+
level: CAN_VIEW
|
|
181
|
+
schedule:
|
|
182
|
+
type: object
|
|
183
|
+
additionalProperties: false
|
|
184
|
+
required: [cron]
|
|
185
|
+
properties:
|
|
186
|
+
cron:
|
|
187
|
+
{
|
|
188
|
+
type: string,
|
|
189
|
+
description: "Quartz cron expression, such as `0 0 6 * * ?`.",
|
|
190
|
+
examples: [0 0 5 * * ?],
|
|
191
|
+
}
|
|
192
|
+
timezone: { type: string, description: "Default: UTC.", examples: [Pacific/Auckland] }
|
|
193
|
+
paused: { type: boolean, description: "Default: paused outside production." }
|
|
194
|
+
description: When the refresh job runs (Quartz cron), its time zone, and whether it is paused.
|
|
195
|
+
examples:
|
|
196
|
+
- cron: 0 0 5 * * ?
|
|
197
|
+
timezone: Pacific/Auckland
|
|
198
|
+
notifications:
|
|
199
|
+
type: object
|
|
200
|
+
additionalProperties: false
|
|
201
|
+
properties:
|
|
202
|
+
on_failure:
|
|
203
|
+
{
|
|
204
|
+
type: array,
|
|
205
|
+
items: { type: string },
|
|
206
|
+
description: Email addresses told when a pipeline or job fails.,
|
|
207
|
+
examples: [[data-team@example.com]],
|
|
208
|
+
}
|
|
209
|
+
description: Who is emailed when an update fails.
|
|
210
|
+
manage:
|
|
211
|
+
type: object
|
|
212
|
+
additionalProperties: false
|
|
213
|
+
properties:
|
|
214
|
+
schemas:
|
|
215
|
+
type: boolean
|
|
216
|
+
description:
|
|
217
|
+
"Create the schemas (with grants) in the bundle. Default: false, because schemas are
|
|
218
|
+
often shared infrastructure."
|
|
219
|
+
tags:
|
|
220
|
+
type: boolean
|
|
221
|
+
description:
|
|
222
|
+
"Apply the contracts' tags and classification to tables and columns as Unity Catalog tags,
|
|
223
|
+
after each refresh. Default: false."
|
|
224
|
+
comments:
|
|
225
|
+
type: boolean
|
|
226
|
+
description: "Apply the contracts' column descriptions as column comments, after each refresh. Default: false."
|
|
227
|
+
checks:
|
|
228
|
+
type: boolean
|
|
229
|
+
description:
|
|
230
|
+
"Run the contracts' rules that compare counts over all rows, such as row counts and
|
|
231
|
+
duplicates, after each refresh. Default: false."
|
|
232
|
+
description: Shared resources and metadata this bundle manages. Each needs privileges on the platform.
|
|
233
|
+
grants:
|
|
234
|
+
type: object
|
|
235
|
+
description: Grants per layer, used when `manage.schemas` is true.
|
|
236
|
+
additionalProperties:
|
|
237
|
+
type: array
|
|
238
|
+
items:
|
|
239
|
+
type: object
|
|
240
|
+
additionalProperties: false
|
|
241
|
+
required: [principal, privileges]
|
|
242
|
+
properties:
|
|
243
|
+
principal:
|
|
244
|
+
{
|
|
245
|
+
type: string,
|
|
246
|
+
description: "The user, group or service principal given the privileges.",
|
|
247
|
+
examples: [data-engineers],
|
|
248
|
+
}
|
|
249
|
+
privileges:
|
|
250
|
+
{
|
|
251
|
+
type: array,
|
|
252
|
+
items: { type: string },
|
|
253
|
+
description: "Unity Catalog privileges, such as USE_SCHEMA, SELECT and MODIFY.",
|
|
254
|
+
}
|
|
255
|
+
examples:
|
|
256
|
+
- bronze:
|
|
257
|
+
- principal: data-engineers
|
|
258
|
+
privileges:
|
|
259
|
+
- USE_SCHEMA
|
|
260
|
+
- SELECT
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
|
2
|
+
title: Standard
|
|
3
|
+
description: >-
|
|
4
|
+
How things are done, shared by many projects: methods per action, naming, layers, quality and
|
|
5
|
+
types. Anything left out uses the pack's defaults.
|
|
6
|
+
type: object
|
|
7
|
+
additionalProperties: false
|
|
8
|
+
required: [apiVersion, kind, id, packs]
|
|
9
|
+
properties:
|
|
10
|
+
apiVersion: { const: ingestron.io/v1, description: Always ingestron.io/v1. }
|
|
11
|
+
kind: { const: Standard, description: The document kind. }
|
|
12
|
+
id:
|
|
13
|
+
{
|
|
14
|
+
type: string,
|
|
15
|
+
pattern: "^[a-z][a-z0-9_-]*$",
|
|
16
|
+
description: "The standard's id: lowercase letters, digits, underscores and hyphens.",
|
|
17
|
+
examples: [acme],
|
|
18
|
+
}
|
|
19
|
+
description:
|
|
20
|
+
{
|
|
21
|
+
type: string,
|
|
22
|
+
description: "What this document is for, in a sentence.",
|
|
23
|
+
examples: [How Acme builds its sales data products.],
|
|
24
|
+
}
|
|
25
|
+
packs:
|
|
26
|
+
type: array
|
|
27
|
+
minItems: 1
|
|
28
|
+
uniqueItems: true
|
|
29
|
+
items: { type: string, pattern: "^[a-z][a-z0-9-]*@[0-9]+$" }
|
|
30
|
+
description: >-
|
|
31
|
+
The packs to use, each with its major version, such as `[databricks@1, adf@1]`. The first
|
|
32
|
+
provides the defaults.
|
|
33
|
+
naming:
|
|
34
|
+
{
|
|
35
|
+
$ref: "#/$defs/naming",
|
|
36
|
+
description: "Name patterns for catalogs, schemas, tables, pipelines and jobs.",
|
|
37
|
+
}
|
|
38
|
+
layers:
|
|
39
|
+
type: array
|
|
40
|
+
minItems: 1
|
|
41
|
+
uniqueItems: true
|
|
42
|
+
items: { type: string, pattern: "^[a-z][a-z0-9_]*$" }
|
|
43
|
+
description: "Layers in order. Flow tables land in the first, transforms in the second. Default:
|
|
44
|
+
bronze, silver, gold."
|
|
45
|
+
types:
|
|
46
|
+
type: object
|
|
47
|
+
description:
|
|
48
|
+
"Platform type for each contract `logicalType`, such as `number: DECIMAL(38,6)`. Used
|
|
49
|
+
when a column has no `physicalType`."
|
|
50
|
+
additionalProperties: { type: string }
|
|
51
|
+
quality:
|
|
52
|
+
type: object
|
|
53
|
+
additionalProperties: false
|
|
54
|
+
properties:
|
|
55
|
+
required:
|
|
56
|
+
enum: [warn, drop, fail]
|
|
57
|
+
description: "Action for rows missing a contract `required` column. Default: warn."
|
|
58
|
+
enumDescriptions:
|
|
59
|
+
- Keep the row and record that it failed.
|
|
60
|
+
- Leave the row out of the table.
|
|
61
|
+
- Stop the update.
|
|
62
|
+
default:
|
|
63
|
+
enum: [warn, drop, fail]
|
|
64
|
+
description: "Action for expectations that name none. Default: warn."
|
|
65
|
+
enumDescriptions:
|
|
66
|
+
- Keep the row and record that it failed.
|
|
67
|
+
- Leave the row out of the table.
|
|
68
|
+
- Stop the update.
|
|
69
|
+
description: "What happens to rows that fail a check: required columns and your own expectations."
|
|
70
|
+
ingest:
|
|
71
|
+
{
|
|
72
|
+
$ref: "#/$defs/rules",
|
|
73
|
+
description: "How tables are ingested: method settings, rules, and allowed and fixed settings.",
|
|
74
|
+
}
|
|
75
|
+
transform:
|
|
76
|
+
{
|
|
77
|
+
$ref: "#/$defs/rules",
|
|
78
|
+
description: "How transforms run: method settings, rules, and allowed and fixed settings.",
|
|
79
|
+
}
|
|
80
|
+
store:
|
|
81
|
+
{
|
|
82
|
+
$ref: "#/$defs/rules",
|
|
83
|
+
description: "How tables are stored: method settings, rules, and allowed and fixed settings.",
|
|
84
|
+
}
|
|
85
|
+
$defs:
|
|
86
|
+
method: { type: string, pattern: "^[a-z][a-z0-9-]*$" }
|
|
87
|
+
naming:
|
|
88
|
+
type: object
|
|
89
|
+
additionalProperties: false
|
|
90
|
+
description: Name patterns (Liquid) with the variables project, environment, layer, table, flow and source.
|
|
91
|
+
properties:
|
|
92
|
+
catalog:
|
|
93
|
+
{
|
|
94
|
+
type: string,
|
|
95
|
+
description: "Name pattern for the catalog. Default: `{{ environment }}`.",
|
|
96
|
+
examples: ["acme_{{ environment }}"],
|
|
97
|
+
}
|
|
98
|
+
schema:
|
|
99
|
+
{
|
|
100
|
+
type: string,
|
|
101
|
+
description: "Name pattern for the schema. Default: `{{ layer }}`.",
|
|
102
|
+
examples: ["{{ environment }}_{{ layer }}"],
|
|
103
|
+
}
|
|
104
|
+
table:
|
|
105
|
+
{
|
|
106
|
+
type: string,
|
|
107
|
+
description: "Name pattern for the table. Default: `{{ table }}`.",
|
|
108
|
+
examples: ["{% if source %}{{ source }}_{% endif %}{{ table }}"],
|
|
109
|
+
}
|
|
110
|
+
pipeline:
|
|
111
|
+
{
|
|
112
|
+
type: string,
|
|
113
|
+
description: "Name pattern for the pipeline. Default: `{{ project }}`.",
|
|
114
|
+
examples: ["{{ project }}_{{ environment }}"],
|
|
115
|
+
}
|
|
116
|
+
job:
|
|
117
|
+
{
|
|
118
|
+
type: string,
|
|
119
|
+
description: "Name pattern for the refresh job. Default: `{{ project }}_refresh`.",
|
|
120
|
+
examples: ["{{ project }}_daily"],
|
|
121
|
+
}
|
|
122
|
+
rules:
|
|
123
|
+
type: object
|
|
124
|
+
additionalProperties: false
|
|
125
|
+
properties:
|
|
126
|
+
default:
|
|
127
|
+
$ref: "#/$defs/method"
|
|
128
|
+
description: "Replaces the pack's default method for this action. For store, none ends flows at the files ingest lands."
|
|
129
|
+
examples:
|
|
130
|
+
- materialised-view
|
|
131
|
+
allowed:
|
|
132
|
+
type: array
|
|
133
|
+
items: { $ref: "#/$defs/method" }
|
|
134
|
+
description: "Methods a flow or transform may name. Default: all of the pack's methods for this action."
|
|
135
|
+
examples:
|
|
136
|
+
- - streaming-table
|
|
137
|
+
- materialised-view
|
|
138
|
+
when:
|
|
139
|
+
type: array
|
|
140
|
+
description:
|
|
141
|
+
Checked in order, before the pack's own rules; the first whose facts all match chooses
|
|
142
|
+
the method.
|
|
143
|
+
items:
|
|
144
|
+
type: object
|
|
145
|
+
additionalProperties: false
|
|
146
|
+
required: [use]
|
|
147
|
+
minProperties: 2
|
|
148
|
+
properties:
|
|
149
|
+
connectivity:
|
|
150
|
+
{
|
|
151
|
+
enum: [public, workspace, private],
|
|
152
|
+
description: "Matches the connection's connectivity: public, workspace or private.",
|
|
153
|
+
enumDescriptions: [
|
|
154
|
+
The data platform reaches the source directly.,
|
|
155
|
+
"The platform reaches it over private networking, such as ExpressRoute or a
|
|
156
|
+
peered network.",
|
|
157
|
+
The platform cannot reach it; something inside the source's network must bring
|
|
158
|
+
the data.,
|
|
159
|
+
],
|
|
160
|
+
}
|
|
161
|
+
connector:
|
|
162
|
+
{
|
|
163
|
+
type: string,
|
|
164
|
+
description: "Matches the connection's connector, such as files or sqlserver.",
|
|
165
|
+
examples: [sqlserver],
|
|
166
|
+
}
|
|
167
|
+
input:
|
|
168
|
+
{
|
|
169
|
+
enum: [files, table, query],
|
|
170
|
+
description: "Matches what the previous action hands over: files, table or query.",
|
|
171
|
+
enumDescriptions:
|
|
172
|
+
[
|
|
173
|
+
"Files in storage, such as those an ingest method lands.",
|
|
174
|
+
"A table, such as one a managed connector writes, or a transform's inputs.",
|
|
175
|
+
"A query, such as a transform's SQL, for the store method to keep.",
|
|
176
|
+
],
|
|
177
|
+
}
|
|
178
|
+
layer:
|
|
179
|
+
{
|
|
180
|
+
type: string,
|
|
181
|
+
description: "Matches the table's layer, such as gold.",
|
|
182
|
+
examples: [gold],
|
|
183
|
+
}
|
|
184
|
+
use:
|
|
185
|
+
{
|
|
186
|
+
$ref: "#/$defs/method",
|
|
187
|
+
description: "The method to use when this rule matches, such as materialised-view.",
|
|
188
|
+
examples: [materialised-view],
|
|
189
|
+
}
|
|
190
|
+
with: { type: object, description: Settings for this case. }
|
|
191
|
+
examples:
|
|
192
|
+
- - connector: sqlserver
|
|
193
|
+
use: lakeflow-connect
|
|
194
|
+
- layer: gold
|
|
195
|
+
use: materialised-view
|
|
196
|
+
settings:
|
|
197
|
+
type: object
|
|
198
|
+
description: Settings per method, over the pack's defaults.
|
|
199
|
+
additionalProperties: { type: object }
|
|
200
|
+
examples:
|
|
201
|
+
- files:
|
|
202
|
+
format: csv
|
|
203
|
+
options:
|
|
204
|
+
header: true
|
|
205
|
+
fixed:
|
|
206
|
+
type: object
|
|
207
|
+
description: Settings per method that nothing may change.
|
|
208
|
+
additionalProperties: { type: object }
|
|
209
|
+
examples:
|
|
210
|
+
- streaming-table:
|
|
211
|
+
cluster_by: auto
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
|
2
|
+
title: Transform
|
|
3
|
+
description: Builds one table from tables that flows or other transforms produce.
|
|
4
|
+
type: object
|
|
5
|
+
additionalProperties: false
|
|
6
|
+
required: [apiVersion, kind, id, inputs, code, contract]
|
|
7
|
+
properties:
|
|
8
|
+
apiVersion: { const: ingestron.io/v1, description: Always ingestron.io/v1. }
|
|
9
|
+
kind: { const: Transform, description: The document kind. }
|
|
10
|
+
id:
|
|
11
|
+
type: string
|
|
12
|
+
pattern: "^[a-z][a-z0-9_]*$"
|
|
13
|
+
description: Name of the table this transform produces.
|
|
14
|
+
examples:
|
|
15
|
+
- daily_sales
|
|
16
|
+
description:
|
|
17
|
+
{
|
|
18
|
+
type: string,
|
|
19
|
+
description: "What this document is for, in a sentence.",
|
|
20
|
+
examples: [Order totals per customer and day.],
|
|
21
|
+
}
|
|
22
|
+
layer:
|
|
23
|
+
{
|
|
24
|
+
type: string,
|
|
25
|
+
description: "Layer of the result. Default: the standard's second layer.",
|
|
26
|
+
examples: [silver],
|
|
27
|
+
}
|
|
28
|
+
inputs:
|
|
29
|
+
type: array
|
|
30
|
+
minItems: 1
|
|
31
|
+
uniqueItems: true
|
|
32
|
+
items: { type: string, pattern: "^[a-z][a-z0-9_]*$" }
|
|
33
|
+
description: Tables the code reads, by table name.
|
|
34
|
+
code:
|
|
35
|
+
type: string
|
|
36
|
+
description: >-
|
|
37
|
+
The code, usually `${file:name.sql}` or `${file:name.py}`. In SQL, write an input as `{{
|
|
38
|
+
tables.orders }}`; it becomes the input's full name. The method (`transform.uses`) says which
|
|
39
|
+
language it is.
|
|
40
|
+
examples:
|
|
41
|
+
- ${file:daily_sales.sql}
|
|
42
|
+
contract:
|
|
43
|
+
{
|
|
44
|
+
type: string,
|
|
45
|
+
description: Id of the DataContract (ODCS) for the result.,
|
|
46
|
+
examples: [shop.daily_sales],
|
|
47
|
+
}
|
|
48
|
+
expectations:
|
|
49
|
+
type: array
|
|
50
|
+
items:
|
|
51
|
+
type: object
|
|
52
|
+
additionalProperties: false
|
|
53
|
+
required: [name, check]
|
|
54
|
+
properties:
|
|
55
|
+
name:
|
|
56
|
+
{
|
|
57
|
+
type: string,
|
|
58
|
+
pattern: "^[a-z][a-z0-9_]*$",
|
|
59
|
+
description: "A name for the check: lowercase letters, digits and underscores.",
|
|
60
|
+
examples: [positive_total],
|
|
61
|
+
}
|
|
62
|
+
check:
|
|
63
|
+
{
|
|
64
|
+
type: string,
|
|
65
|
+
description: "A SQL condition every valid row meets, such as `total >= 0`.",
|
|
66
|
+
examples: [total >= 0],
|
|
67
|
+
}
|
|
68
|
+
action:
|
|
69
|
+
{
|
|
70
|
+
enum: [warn, drop, fail],
|
|
71
|
+
description: "What happens to rows that fail: warn, drop or fail. Default: the standard's.",
|
|
72
|
+
enumDescriptions:
|
|
73
|
+
[
|
|
74
|
+
Keep the row and record that it failed.,
|
|
75
|
+
Leave the row out of the table.,
|
|
76
|
+
Stop the update.,
|
|
77
|
+
],
|
|
78
|
+
}
|
|
79
|
+
description: Your own checks on the table's rows.
|
|
80
|
+
transform: { $ref: "#/$defs/transform", description: How the code runs. }
|
|
81
|
+
store: { $ref: "#/$defs/store", description: How the result is kept. }
|
|
82
|
+
$defs:
|
|
83
|
+
transform:
|
|
84
|
+
type: object
|
|
85
|
+
additionalProperties: false
|
|
86
|
+
properties:
|
|
87
|
+
uses:
|
|
88
|
+
type: string
|
|
89
|
+
pattern: ^[a-z][a-z0-9-]*$
|
|
90
|
+
description: The method for this step, instead of the standard's choice, such as pyspark.
|
|
91
|
+
examples:
|
|
92
|
+
- sql
|
|
93
|
+
with:
|
|
94
|
+
type: object
|
|
95
|
+
description: Settings for the method, over the standard's.
|
|
96
|
+
store:
|
|
97
|
+
type: object
|
|
98
|
+
additionalProperties: false
|
|
99
|
+
properties:
|
|
100
|
+
uses:
|
|
101
|
+
type: string
|
|
102
|
+
pattern: ^[a-z][a-z0-9-]*$
|
|
103
|
+
description: The method for this step, instead of the standard's choice, such as pyspark.
|
|
104
|
+
examples:
|
|
105
|
+
- materialised-view
|
|
106
|
+
with:
|
|
107
|
+
type: object
|
|
108
|
+
description: Settings for the method, over the standard's.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# {{ header }}
|
|
2
|
+
# Runs after each refresh: Lakeflow pipelines cannot set tags or column
|
|
3
|
+
# comments, nor compare counts over all rows, so this task does.
|
|
4
|
+
import json
|
|
5
|
+
|
|
6
|
+
from pyspark.sql import SparkSession
|
|
7
|
+
|
|
8
|
+
STATEMENTS = json.loads(r"""{{ statements }}""")
|
|
9
|
+
CHECKS = json.loads(r"""{{ checks }}""")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def passes(operator, expected, measured):
|
|
13
|
+
"""True when the measured count meets the rule's comparison."""
|
|
14
|
+
if operator == "mustBe":
|
|
15
|
+
return measured == expected
|
|
16
|
+
if operator == "mustNotBe":
|
|
17
|
+
return measured != expected
|
|
18
|
+
if operator == "mustBeGreaterThan":
|
|
19
|
+
return measured > expected
|
|
20
|
+
if operator == "mustBeGreaterOrEqualTo":
|
|
21
|
+
return measured >= expected
|
|
22
|
+
if operator == "mustBeLessThan":
|
|
23
|
+
return measured < expected
|
|
24
|
+
if operator == "mustBeLessOrEqualTo":
|
|
25
|
+
return measured <= expected
|
|
26
|
+
low, high = expected
|
|
27
|
+
inside = low <= measured <= high
|
|
28
|
+
return inside if operator == "mustBeBetween" else not inside
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def measure(spark, check):
|
|
32
|
+
"""The rule's count, in rows or as a percentage of all rows."""
|
|
33
|
+
row = spark.sql(check["query"]).first()
|
|
34
|
+
counted, total = row["counted"] or 0, row["total"] or 0
|
|
35
|
+
if check["unit"] == "percent":
|
|
36
|
+
return 0 if total == 0 else counted * 100 / total
|
|
37
|
+
return counted
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def main():
|
|
41
|
+
spark = SparkSession.builder.getOrCreate()
|
|
42
|
+
for statement in STATEMENTS:
|
|
43
|
+
spark.sql(statement)
|
|
44
|
+
failures = []
|
|
45
|
+
for check in CHECKS:
|
|
46
|
+
measured = measure(spark, check)
|
|
47
|
+
if passes(check["operator"], check["value"], measured):
|
|
48
|
+
continue
|
|
49
|
+
message = f'{check["table"]}: {check["name"]} measured {measured}, expected {check["operator"]} {check["value"]}'
|
|
50
|
+
if check["action"] == "fail":
|
|
51
|
+
failures.append(message)
|
|
52
|
+
else:
|
|
53
|
+
print(f"Warning: {message}")
|
|
54
|
+
if failures:
|
|
55
|
+
raise RuntimeError("Table checks failed:\n" + "\n".join(failures))
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
main()
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
-- {{ header }}
|
|
2
|
+
-- Changes as received, each read once.
|
|
3
|
+
CREATE OR REFRESH STREAMING TABLE {{ cdc.changes }}
|
|
4
|
+
AS {% render "read-files", source: source %};
|
|
5
|
+
|
|
6
|
+
-- The current rows{% if cdc.scd == 2 %}, with history{% endif %}, kept by key.
|
|
7
|
+
{% render "table", table: table %};
|
|
8
|
+
|
|
9
|
+
CREATE FLOW {{ cdc.flow }}
|
|
10
|
+
AS AUTO CDC INTO {{ table.target }}
|
|
11
|
+
FROM STREAM({{ cdc.changes }})
|
|
12
|
+
KEYS ({{ cdc.keys }})
|
|
13
|
+
{%- if cdc.delete_when != "" %}
|
|
14
|
+
APPLY AS DELETE WHEN {{ cdc.delete_when }}
|
|
15
|
+
{%- endif %}
|
|
16
|
+
SEQUENCE BY {{ cdc.sequence }}
|
|
17
|
+
{%- if cdc.except_columns != "" %}
|
|
18
|
+
COLUMNS * EXCEPT ({{ cdc.except_columns }})
|
|
19
|
+
{%- endif %}
|
|
20
|
+
STORED AS SCD TYPE {{ cdc.scd }};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# {{ header }}
|
|
2
|
+
from pyspark import pipelines as dp
|
|
3
|
+
|
|
4
|
+
# The transform's own code, unchanged:
|
|
5
|
+
{{ code }}
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@dp.materialized_view(
|
|
9
|
+
name={{ name }},
|
|
10
|
+
{%- if comment != "" %}
|
|
11
|
+
comment={{ comment }},
|
|
12
|
+
{%- endif %}
|
|
13
|
+
{%- if cluster != "" %}
|
|
14
|
+
{{ cluster }},
|
|
15
|
+
{%- endif %}
|
|
16
|
+
{%- if properties != "" %}
|
|
17
|
+
table_properties={{ properties }},
|
|
18
|
+
{%- endif %}
|
|
19
|
+
)
|
|
20
|
+
{%- for group in expectations %}
|
|
21
|
+
@dp.{{ group.decorator }}({{ group.checks }})
|
|
22
|
+
{%- endfor %}
|
|
23
|
+
def {{ wrapper }}():
|
|
24
|
+
return {{ function }}({
|
|
25
|
+
{%- for input in inputs %}
|
|
26
|
+
{{ input.name }}: spark.read.table({{ input.table }}),
|
|
27
|
+
{%- endfor %}
|
|
28
|
+
})
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{%- comment %} Ends without a newline: the caller continues after it. {% endcomment -%}
|
|
2
|
+
SELECT {{ source.select }} FROM {% if source.stream %}STREAM {% endif %}read_files(
|
|
3
|
+
{{ source.path }}
|
|
4
|
+
{%- for option in source.options %},
|
|
5
|
+
{{ option.key }} => {{ option.value }}
|
|
6
|
+
{%- endfor %}
|
|
7
|
+
){%- comment %}{% endcomment -%}
|