ingestron 0.17.8 → 1.0.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.
Files changed (273) hide show
  1. package/NOTICE +3 -5
  2. package/README.md +26 -74
  3. package/THIRD_PARTY_NOTICES +148 -0
  4. package/dist/main.js +29188 -0
  5. package/package.json +32 -65
  6. package/project-recipes/adf/connections/adls-gen2.yaml +7 -0
  7. package/project-recipes/adf/connections/amazon-rds-oracle.yaml +9 -0
  8. package/project-recipes/adf/connections/amazon-rds-sqlserver.yaml +9 -0
  9. package/project-recipes/adf/connections/amazon-redshift.yaml +10 -0
  10. package/project-recipes/adf/connections/amazon-s3.yaml +8 -0
  11. package/project-recipes/adf/connections/azure-blob.yaml +7 -0
  12. package/project-recipes/adf/connections/azure-cosmos-db-mongodb.yaml +8 -0
  13. package/project-recipes/adf/connections/azure-cosmos-db-nosql.yaml +8 -0
  14. package/project-recipes/adf/connections/azure-cosmos-postgresql.yaml +10 -0
  15. package/project-recipes/adf/connections/azure-data-explorer.yaml +8 -0
  16. package/project-recipes/adf/connections/azure-databricks-delta.yaml +9 -0
  17. package/project-recipes/adf/connections/azure-files.yaml +8 -0
  18. package/project-recipes/adf/connections/azure-mysql.yaml +7 -0
  19. package/project-recipes/adf/connections/azure-postgresql.yaml +10 -0
  20. package/project-recipes/adf/connections/azure-sql-database.yaml +9 -0
  21. package/project-recipes/adf/connections/azure-sql-managed-instance.yaml +9 -0
  22. package/project-recipes/adf/connections/azure-synapse.yaml +9 -0
  23. package/project-recipes/adf/connections/azure-table-storage.yaml +7 -0
  24. package/project-recipes/adf/connections/cassandra.yaml +9 -0
  25. package/project-recipes/adf/connections/dataverse.yaml +9 -0
  26. package/project-recipes/adf/connections/db2.yaml +7 -0
  27. package/project-recipes/adf/connections/dynamics-365.yaml +9 -0
  28. package/project-recipes/adf/connections/dynamics-ax.yaml +11 -0
  29. package/project-recipes/adf/connections/dynamics-crm.yaml +9 -0
  30. package/project-recipes/adf/connections/fabric-lakehouse.yaml +8 -0
  31. package/project-recipes/adf/connections/fabric-warehouse.yaml +9 -0
  32. package/project-recipes/adf/connections/files.yaml +9 -0
  33. package/project-recipes/adf/connections/ftp.yaml +9 -0
  34. package/project-recipes/adf/connections/google-ads.yaml +12 -0
  35. package/project-recipes/adf/connections/google-bigquery.yaml +8 -0
  36. package/project-recipes/adf/connections/google-cloud-storage.yaml +8 -0
  37. package/project-recipes/adf/connections/greenplum.yaml +10 -0
  38. package/project-recipes/adf/connections/hdfs.yaml +9 -0
  39. package/project-recipes/adf/connections/hive.yaml +11 -0
  40. package/project-recipes/adf/connections/http.yaml +7 -0
  41. package/project-recipes/adf/connections/hubspot.yaml +10 -0
  42. package/project-recipes/adf/connections/impala.yaml +11 -0
  43. package/project-recipes/adf/connections/informix.yaml +9 -0
  44. package/project-recipes/adf/connections/jira.yaml +9 -0
  45. package/project-recipes/adf/connections/mariadb.yaml +10 -0
  46. package/project-recipes/adf/connections/microsoft-365.yaml +10 -0
  47. package/project-recipes/adf/connections/microsoft-access.yaml +9 -0
  48. package/project-recipes/adf/connections/mongodb-atlas.yaml +8 -0
  49. package/project-recipes/adf/connections/mongodb.yaml +8 -0
  50. package/project-recipes/adf/connections/mysql.yaml +10 -0
  51. package/project-recipes/adf/connections/netezza.yaml +11 -0
  52. package/project-recipes/adf/connections/odata.yaml +9 -0
  53. package/project-recipes/adf/connections/odbc.yaml +9 -0
  54. package/project-recipes/adf/connections/oracle-cloud-storage.yaml +9 -0
  55. package/project-recipes/adf/connections/oracle.yaml +9 -0
  56. package/project-recipes/adf/connections/postgresql.yaml +10 -0
  57. package/project-recipes/adf/connections/presto.yaml +11 -0
  58. package/project-recipes/adf/connections/quickbooks.yaml +10 -0
  59. package/project-recipes/adf/connections/rest.yaml +12 -0
  60. package/project-recipes/adf/connections/s3-compatible.yaml +9 -0
  61. package/project-recipes/adf/connections/salesforce-service-cloud.yaml +10 -0
  62. package/project-recipes/adf/connections/salesforce.yaml +10 -0
  63. package/project-recipes/adf/connections/sap-bw-mdx.yaml +11 -0
  64. package/project-recipes/adf/connections/sap-bw-open-hub.yaml +11 -0
  65. package/project-recipes/adf/connections/sap-c4c.yaml +9 -0
  66. package/project-recipes/adf/connections/sap-ecc.yaml +9 -0
  67. package/project-recipes/adf/connections/sap-hana.yaml +7 -0
  68. package/project-recipes/adf/connections/sap-table.yaml +11 -0
  69. package/project-recipes/adf/connections/servicenow.yaml +9 -0
  70. package/project-recipes/adf/connections/sftp.yaml +10 -0
  71. package/project-recipes/adf/connections/sharepoint-online-list.yaml +10 -0
  72. package/project-recipes/adf/connections/shopify.yaml +8 -0
  73. package/project-recipes/adf/connections/snowflake.yaml +11 -0
  74. package/project-recipes/adf/connections/spark.yaml +11 -0
  75. package/project-recipes/adf/connections/sqlserver.yaml +9 -0
  76. package/project-recipes/adf/connections/square.yaml +10 -0
  77. package/project-recipes/adf/connections/sybase.yaml +10 -0
  78. package/project-recipes/adf/connections/teradata.yaml +9 -0
  79. package/project-recipes/adf/connections/vertica.yaml +10 -0
  80. package/project-recipes/adf/connections/web-table.yaml +7 -0
  81. package/project-recipes/adf/connections/xero.yaml +10 -0
  82. package/project-recipes/adf/contracts/records.yaml +12 -0
  83. package/project-recipes/adf/contracts/salesforce-account.yaml +12 -0
  84. package/project-recipes/adf/flows/adls-gen2.yaml +14 -0
  85. package/project-recipes/adf/flows/amazon-rds-oracle.yaml +12 -0
  86. package/project-recipes/adf/flows/amazon-rds-sqlserver.yaml +12 -0
  87. package/project-recipes/adf/flows/amazon-redshift.yaml +12 -0
  88. package/project-recipes/adf/flows/amazon-s3.yaml +14 -0
  89. package/project-recipes/adf/flows/azure-blob.yaml +14 -0
  90. package/project-recipes/adf/flows/azure-cosmos-db-mongodb.yaml +12 -0
  91. package/project-recipes/adf/flows/azure-cosmos-db-nosql.yaml +12 -0
  92. package/project-recipes/adf/flows/azure-cosmos-postgresql.yaml +12 -0
  93. package/project-recipes/adf/flows/azure-data-explorer.yaml +13 -0
  94. package/project-recipes/adf/flows/azure-databricks-delta.yaml +15 -0
  95. package/project-recipes/adf/flows/azure-files.yaml +14 -0
  96. package/project-recipes/adf/flows/azure-mysql.yaml +12 -0
  97. package/project-recipes/adf/flows/azure-postgresql.yaml +12 -0
  98. package/project-recipes/adf/flows/azure-sql-database.yaml +12 -0
  99. package/project-recipes/adf/flows/azure-sql-managed-instance.yaml +12 -0
  100. package/project-recipes/adf/flows/azure-synapse.yaml +12 -0
  101. package/project-recipes/adf/flows/azure-table-storage.yaml +12 -0
  102. package/project-recipes/adf/flows/cassandra.yaml +12 -0
  103. package/project-recipes/adf/flows/dataverse.yaml +12 -0
  104. package/project-recipes/adf/flows/db2.yaml +12 -0
  105. package/project-recipes/adf/flows/dynamics-365.yaml +12 -0
  106. package/project-recipes/adf/flows/dynamics-ax.yaml +12 -0
  107. package/project-recipes/adf/flows/dynamics-crm.yaml +12 -0
  108. package/project-recipes/adf/flows/fabric-lakehouse.yaml +14 -0
  109. package/project-recipes/adf/flows/fabric-warehouse.yaml +14 -0
  110. package/project-recipes/adf/flows/files.yaml +14 -0
  111. package/project-recipes/adf/flows/ftp.yaml +14 -0
  112. package/project-recipes/adf/flows/google-ads.yaml +13 -0
  113. package/project-recipes/adf/flows/google-bigquery.yaml +12 -0
  114. package/project-recipes/adf/flows/google-cloud-storage.yaml +14 -0
  115. package/project-recipes/adf/flows/greenplum.yaml +12 -0
  116. package/project-recipes/adf/flows/hdfs.yaml +14 -0
  117. package/project-recipes/adf/flows/hive.yaml +12 -0
  118. package/project-recipes/adf/flows/http.yaml +18 -0
  119. package/project-recipes/adf/flows/hubspot.yaml +12 -0
  120. package/project-recipes/adf/flows/impala.yaml +12 -0
  121. package/project-recipes/adf/flows/informix.yaml +13 -0
  122. package/project-recipes/adf/flows/jira.yaml +12 -0
  123. package/project-recipes/adf/flows/mariadb.yaml +13 -0
  124. package/project-recipes/adf/flows/microsoft-365.yaml +19 -0
  125. package/project-recipes/adf/flows/microsoft-access.yaml +13 -0
  126. package/project-recipes/adf/flows/mongodb-atlas.yaml +12 -0
  127. package/project-recipes/adf/flows/mongodb.yaml +12 -0
  128. package/project-recipes/adf/flows/mysql.yaml +12 -0
  129. package/project-recipes/adf/flows/netezza.yaml +13 -0
  130. package/project-recipes/adf/flows/odata.yaml +12 -0
  131. package/project-recipes/adf/flows/odbc.yaml +13 -0
  132. package/project-recipes/adf/flows/oracle-cloud-storage.yaml +14 -0
  133. package/project-recipes/adf/flows/oracle.yaml +12 -0
  134. package/project-recipes/adf/flows/postgresql.yaml +18 -0
  135. package/project-recipes/adf/flows/presto.yaml +12 -0
  136. package/project-recipes/adf/flows/quickbooks.yaml +12 -0
  137. package/project-recipes/adf/flows/rest.yaml +21 -0
  138. package/project-recipes/adf/flows/s3-compatible.yaml +14 -0
  139. package/project-recipes/adf/flows/salesforce-service-cloud.yaml +12 -0
  140. package/project-recipes/adf/flows/salesforce.yaml +13 -0
  141. package/project-recipes/adf/flows/sap-bw-mdx.yaml +14 -0
  142. package/project-recipes/adf/flows/sap-bw-open-hub.yaml +13 -0
  143. package/project-recipes/adf/flows/sap-c4c.yaml +12 -0
  144. package/project-recipes/adf/flows/sap-ecc.yaml +13 -0
  145. package/project-recipes/adf/flows/sap-hana.yaml +14 -0
  146. package/project-recipes/adf/flows/sap-table.yaml +13 -0
  147. package/project-recipes/adf/flows/servicenow.yaml +12 -0
  148. package/project-recipes/adf/flows/sftp.yaml +14 -0
  149. package/project-recipes/adf/flows/sharepoint-online-list.yaml +12 -0
  150. package/project-recipes/adf/flows/shopify.yaml +12 -0
  151. package/project-recipes/adf/flows/snowflake.yaml +15 -0
  152. package/project-recipes/adf/flows/spark.yaml +12 -0
  153. package/project-recipes/adf/flows/sqlserver.yaml +12 -0
  154. package/project-recipes/adf/flows/square.yaml +13 -0
  155. package/project-recipes/adf/flows/sybase.yaml +13 -0
  156. package/project-recipes/adf/flows/teradata.yaml +12 -0
  157. package/project-recipes/adf/flows/vertica.yaml +12 -0
  158. package/project-recipes/adf/flows/web-table.yaml +14 -0
  159. package/project-recipes/adf/flows/xero.yaml +12 -0
  160. package/project-recipes/adf/platform.yaml +29 -0
  161. package/project-recipes/adf/project.yaml +10 -0
  162. package/project-recipes/adf/sample.yaml +3 -0
  163. package/project-recipes/adf/standard.yaml +15 -0
  164. package/project-templates/kafka/README.md +12 -0
  165. package/project-templates/kafka/connections/events.yaml +8 -0
  166. package/project-templates/kafka/contracts/page_views.yaml +13 -0
  167. package/project-templates/kafka/contracts/purchases.yaml +13 -0
  168. package/project-templates/kafka/flows/events.yaml +10 -0
  169. package/project-templates/kafka/project.yaml +10 -0
  170. package/project-templates/kafka/standard.yaml +4 -0
  171. package/project-templates/kafka/template.yaml +3 -0
  172. package/project-templates/minimal/README.md +10 -0
  173. package/project-templates/minimal/connections/shop.yaml +7 -0
  174. package/project-templates/minimal/contracts/orders.yaml +14 -0
  175. package/project-templates/minimal/flows/orders.yaml +6 -0
  176. package/project-templates/minimal/project.yaml +11 -0
  177. package/project-templates/minimal/standard.yaml +4 -0
  178. package/project-templates/minimal/template.yaml +7 -0
  179. package/project-templates/private-files/README.md +29 -0
  180. package/project-templates/private-files/connections/share.yaml +10 -0
  181. package/project-templates/private-files/contracts/sales.yaml +14 -0
  182. package/project-templates/private-files/contracts/stock.yaml +14 -0
  183. package/project-templates/private-files/flows/stores.yaml +9 -0
  184. package/project-templates/private-files/platform.yaml +11 -0
  185. package/project-templates/private-files/project.yaml +19 -0
  186. package/project-templates/private-files/standard.yaml +11 -0
  187. package/project-templates/private-files/template.yaml +10 -0
  188. package/project-templates/private-sql-server/README.md +25 -0
  189. package/project-templates/private-sql-server/connections/erp.yaml +10 -0
  190. package/project-templates/private-sql-server/contracts/customers.yaml +14 -0
  191. package/project-templates/private-sql-server/contracts/invoices.yaml +15 -0
  192. package/project-templates/private-sql-server/flows/erp.yaml +13 -0
  193. package/project-templates/private-sql-server/platform.yaml +11 -0
  194. package/project-templates/private-sql-server/project.yaml +19 -0
  195. package/project-templates/private-sql-server/standard.yaml +17 -0
  196. package/project-templates/private-sql-server/template.yaml +10 -0
  197. package/project-templates/pyspark/README.md +12 -0
  198. package/project-templates/pyspark/connections/billing.yaml +7 -0
  199. package/project-templates/pyspark/contracts/invoices.yaml +16 -0
  200. package/project-templates/pyspark/contracts/monthly_revenue.yaml +14 -0
  201. package/project-templates/pyspark/flows/billing.yaml +6 -0
  202. package/project-templates/pyspark/project.yaml +11 -0
  203. package/project-templates/pyspark/standard.yaml +4 -0
  204. package/project-templates/pyspark/template.yaml +3 -0
  205. package/project-templates/pyspark/transforms/monthly_revenue.py +10 -0
  206. package/project-templates/pyspark/transforms/monthly_revenue.yaml +10 -0
  207. package/project-templates/retail/README.md +22 -0
  208. package/project-templates/retail/connections/shop.yaml +8 -0
  209. package/project-templates/retail/contracts/customers.yaml +12 -0
  210. package/project-templates/retail/contracts/daily_sales.yaml +19 -0
  211. package/project-templates/retail/contracts/orders.yaml +16 -0
  212. package/project-templates/retail/flows/shop.yaml +18 -0
  213. package/project-templates/retail/platform.yaml +21 -0
  214. package/project-templates/retail/project.yaml +18 -0
  215. package/project-templates/retail/standard.yaml +15 -0
  216. package/project-templates/retail/template.yaml +10 -0
  217. package/project-templates/retail/transforms/daily_sales.sql +7 -0
  218. package/project-templates/retail/transforms/daily_sales.yaml +7 -0
  219. package/project-templates/salesforce/README.md +6 -0
  220. package/project-templates/salesforce/connections/salesforce.yaml +7 -0
  221. package/project-templates/salesforce/contracts/accounts.yaml +13 -0
  222. package/project-templates/salesforce/contracts/opportunities.yaml +14 -0
  223. package/project-templates/salesforce/flows/salesforce.yaml +7 -0
  224. package/project-templates/salesforce/project.yaml +9 -0
  225. package/project-templates/salesforce/standard.yaml +4 -0
  226. package/project-templates/salesforce/template.yaml +3 -0
  227. package/project-templates/sql-server/README.md +17 -0
  228. package/project-templates/sql-server/connections/erp.yaml +8 -0
  229. package/project-templates/sql-server/contracts/customer_balances.yaml +13 -0
  230. package/project-templates/sql-server/contracts/customers.yaml +13 -0
  231. package/project-templates/sql-server/contracts/invoices.yaml +14 -0
  232. package/project-templates/sql-server/flows/erp.yaml +13 -0
  233. package/project-templates/sql-server/platform.yaml +6 -0
  234. package/project-templates/sql-server/project.yaml +13 -0
  235. package/project-templates/sql-server/standard.yaml +9 -0
  236. package/project-templates/sql-server/template.yaml +3 -0
  237. package/project-templates/sql-server/transforms/customer_balances.sql +5 -0
  238. package/project-templates/sql-server/transforms/customer_balances.yaml +6 -0
  239. package/schemas/NOTICE.md +7 -0
  240. package/schemas/connection.schema.yaml +37 -0
  241. package/schemas/flow.schema.yaml +124 -0
  242. package/schemas/odcs-v3.1.0.schema.json +2808 -0
  243. package/schemas/platform.schema.yaml +260 -0
  244. package/schemas/standard.schema.yaml +211 -0
  245. package/schemas/transform.schema.yaml +108 -0
  246. package/templates/apply-contract.py.liquid +58 -0
  247. package/templates/change-data.sql.liquid +20 -0
  248. package/templates/materialised-view.py.liquid +28 -0
  249. package/templates/materialised-view.sql.liquid +4 -0
  250. package/templates/read-files.liquid +7 -0
  251. package/templates/streaming-table.sql.liquid +3 -0
  252. package/templates/table.liquid +17 -0
  253. package/CHANGELOG.md +0 -162
  254. package/SECURITY.md +0 -32
  255. package/THIRD_PARTY_NOTICES.md +0 -3678
  256. package/build/cli/cli/index.d.ts +0 -2
  257. package/build/cli/cli/index.js +0 -685
  258. package/build/cli/cli/operation-worker.d.ts +0 -1
  259. package/build/cli/cli/operation-worker.js +0 -5
  260. package/build/cli/cli/output.d.ts +0 -3
  261. package/build/cli/cli/output.js +0 -246
  262. package/build/cli/cli/plugin-browser.d.ts +0 -14
  263. package/build/cli/cli/plugin-browser.js +0 -74
  264. package/build/cli/cli/plugin-resolution.d.ts +0 -126
  265. package/build/cli/cli/plugin-resolution.js +0 -270
  266. package/build/cli/cli/presentation.d.ts +0 -12
  267. package/build/cli/cli/presentation.js +0 -57
  268. package/build/cli/cli/workflow-commands.d.ts +0 -15
  269. package/build/cli/cli/workflow-commands.js +0 -430
  270. package/build/cli/mcp/index.d.ts +0 -3
  271. package/build/cli/mcp/index.js +0 -67
  272. package/build/cli/version.d.ts +0 -2
  273. 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.
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,4 @@
1
+ -- {{ header }}
2
+ {% render "table", table: table %}
3
+ AS
4
+ {% if query != "" %}{{ query }}{% else %}{% render "read-files", source: source %}{% endif %};
@@ -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 -%}