ingestron 0.17.7 → 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.
- package/NOTICE +3 -5
- package/README.md +26 -74
- package/THIRD_PARTY_NOTICES +148 -0
- package/dist/main.js +29188 -0
- package/package.json +32 -65
- package/project-recipes/adf/connections/adls-gen2.yaml +7 -0
- package/project-recipes/adf/connections/amazon-rds-oracle.yaml +9 -0
- package/project-recipes/adf/connections/amazon-rds-sqlserver.yaml +9 -0
- package/project-recipes/adf/connections/amazon-redshift.yaml +10 -0
- package/project-recipes/adf/connections/amazon-s3.yaml +8 -0
- package/project-recipes/adf/connections/azure-blob.yaml +7 -0
- package/project-recipes/adf/connections/azure-cosmos-db-mongodb.yaml +8 -0
- package/project-recipes/adf/connections/azure-cosmos-db-nosql.yaml +8 -0
- package/project-recipes/adf/connections/azure-cosmos-postgresql.yaml +10 -0
- package/project-recipes/adf/connections/azure-data-explorer.yaml +8 -0
- package/project-recipes/adf/connections/azure-databricks-delta.yaml +9 -0
- package/project-recipes/adf/connections/azure-files.yaml +8 -0
- package/project-recipes/adf/connections/azure-mysql.yaml +7 -0
- package/project-recipes/adf/connections/azure-postgresql.yaml +10 -0
- package/project-recipes/adf/connections/azure-sql-database.yaml +9 -0
- package/project-recipes/adf/connections/azure-sql-managed-instance.yaml +9 -0
- package/project-recipes/adf/connections/azure-synapse.yaml +9 -0
- package/project-recipes/adf/connections/azure-table-storage.yaml +7 -0
- package/project-recipes/adf/connections/cassandra.yaml +9 -0
- package/project-recipes/adf/connections/dataverse.yaml +9 -0
- package/project-recipes/adf/connections/db2.yaml +7 -0
- package/project-recipes/adf/connections/dynamics-365.yaml +9 -0
- package/project-recipes/adf/connections/dynamics-ax.yaml +11 -0
- package/project-recipes/adf/connections/dynamics-crm.yaml +9 -0
- package/project-recipes/adf/connections/fabric-lakehouse.yaml +8 -0
- package/project-recipes/adf/connections/fabric-warehouse.yaml +9 -0
- package/project-recipes/adf/connections/files.yaml +9 -0
- package/project-recipes/adf/connections/ftp.yaml +9 -0
- package/project-recipes/adf/connections/google-ads.yaml +12 -0
- package/project-recipes/adf/connections/google-bigquery.yaml +8 -0
- package/project-recipes/adf/connections/google-cloud-storage.yaml +8 -0
- package/project-recipes/adf/connections/greenplum.yaml +10 -0
- package/project-recipes/adf/connections/hdfs.yaml +9 -0
- package/project-recipes/adf/connections/hive.yaml +11 -0
- package/project-recipes/adf/connections/http.yaml +7 -0
- package/project-recipes/adf/connections/hubspot.yaml +10 -0
- package/project-recipes/adf/connections/impala.yaml +11 -0
- package/project-recipes/adf/connections/informix.yaml +9 -0
- package/project-recipes/adf/connections/jira.yaml +9 -0
- package/project-recipes/adf/connections/mariadb.yaml +10 -0
- package/project-recipes/adf/connections/microsoft-365.yaml +10 -0
- package/project-recipes/adf/connections/microsoft-access.yaml +9 -0
- package/project-recipes/adf/connections/mongodb-atlas.yaml +8 -0
- package/project-recipes/adf/connections/mongodb.yaml +8 -0
- package/project-recipes/adf/connections/mysql.yaml +10 -0
- package/project-recipes/adf/connections/netezza.yaml +11 -0
- package/project-recipes/adf/connections/odata.yaml +9 -0
- package/project-recipes/adf/connections/odbc.yaml +9 -0
- package/project-recipes/adf/connections/oracle-cloud-storage.yaml +9 -0
- package/project-recipes/adf/connections/oracle.yaml +9 -0
- package/project-recipes/adf/connections/postgresql.yaml +10 -0
- package/project-recipes/adf/connections/presto.yaml +11 -0
- package/project-recipes/adf/connections/quickbooks.yaml +10 -0
- package/project-recipes/adf/connections/rest.yaml +12 -0
- package/project-recipes/adf/connections/s3-compatible.yaml +9 -0
- package/project-recipes/adf/connections/salesforce-service-cloud.yaml +10 -0
- package/project-recipes/adf/connections/salesforce.yaml +10 -0
- package/project-recipes/adf/connections/sap-bw-mdx.yaml +11 -0
- package/project-recipes/adf/connections/sap-bw-open-hub.yaml +11 -0
- package/project-recipes/adf/connections/sap-c4c.yaml +9 -0
- package/project-recipes/adf/connections/sap-ecc.yaml +9 -0
- package/project-recipes/adf/connections/sap-hana.yaml +7 -0
- package/project-recipes/adf/connections/sap-table.yaml +11 -0
- package/project-recipes/adf/connections/servicenow.yaml +9 -0
- package/project-recipes/adf/connections/sftp.yaml +10 -0
- package/project-recipes/adf/connections/sharepoint-online-list.yaml +10 -0
- package/project-recipes/adf/connections/shopify.yaml +8 -0
- package/project-recipes/adf/connections/snowflake.yaml +11 -0
- package/project-recipes/adf/connections/spark.yaml +11 -0
- package/project-recipes/adf/connections/sqlserver.yaml +9 -0
- package/project-recipes/adf/connections/square.yaml +10 -0
- package/project-recipes/adf/connections/sybase.yaml +10 -0
- package/project-recipes/adf/connections/teradata.yaml +9 -0
- package/project-recipes/adf/connections/vertica.yaml +10 -0
- package/project-recipes/adf/connections/web-table.yaml +7 -0
- package/project-recipes/adf/connections/xero.yaml +10 -0
- package/project-recipes/adf/contracts/records.yaml +12 -0
- package/project-recipes/adf/contracts/salesforce-account.yaml +12 -0
- package/project-recipes/adf/flows/adls-gen2.yaml +14 -0
- package/project-recipes/adf/flows/amazon-rds-oracle.yaml +12 -0
- package/project-recipes/adf/flows/amazon-rds-sqlserver.yaml +12 -0
- package/project-recipes/adf/flows/amazon-redshift.yaml +12 -0
- package/project-recipes/adf/flows/amazon-s3.yaml +14 -0
- package/project-recipes/adf/flows/azure-blob.yaml +14 -0
- package/project-recipes/adf/flows/azure-cosmos-db-mongodb.yaml +12 -0
- package/project-recipes/adf/flows/azure-cosmos-db-nosql.yaml +12 -0
- package/project-recipes/adf/flows/azure-cosmos-postgresql.yaml +12 -0
- package/project-recipes/adf/flows/azure-data-explorer.yaml +13 -0
- package/project-recipes/adf/flows/azure-databricks-delta.yaml +15 -0
- package/project-recipes/adf/flows/azure-files.yaml +14 -0
- package/project-recipes/adf/flows/azure-mysql.yaml +12 -0
- package/project-recipes/adf/flows/azure-postgresql.yaml +12 -0
- package/project-recipes/adf/flows/azure-sql-database.yaml +12 -0
- package/project-recipes/adf/flows/azure-sql-managed-instance.yaml +12 -0
- package/project-recipes/adf/flows/azure-synapse.yaml +12 -0
- package/project-recipes/adf/flows/azure-table-storage.yaml +12 -0
- package/project-recipes/adf/flows/cassandra.yaml +12 -0
- package/project-recipes/adf/flows/dataverse.yaml +12 -0
- package/project-recipes/adf/flows/db2.yaml +12 -0
- package/project-recipes/adf/flows/dynamics-365.yaml +12 -0
- package/project-recipes/adf/flows/dynamics-ax.yaml +12 -0
- package/project-recipes/adf/flows/dynamics-crm.yaml +12 -0
- package/project-recipes/adf/flows/fabric-lakehouse.yaml +14 -0
- package/project-recipes/adf/flows/fabric-warehouse.yaml +14 -0
- package/project-recipes/adf/flows/files.yaml +14 -0
- package/project-recipes/adf/flows/ftp.yaml +14 -0
- package/project-recipes/adf/flows/google-ads.yaml +13 -0
- package/project-recipes/adf/flows/google-bigquery.yaml +12 -0
- package/project-recipes/adf/flows/google-cloud-storage.yaml +14 -0
- package/project-recipes/adf/flows/greenplum.yaml +12 -0
- package/project-recipes/adf/flows/hdfs.yaml +14 -0
- package/project-recipes/adf/flows/hive.yaml +12 -0
- package/project-recipes/adf/flows/http.yaml +18 -0
- package/project-recipes/adf/flows/hubspot.yaml +12 -0
- package/project-recipes/adf/flows/impala.yaml +12 -0
- package/project-recipes/adf/flows/informix.yaml +13 -0
- package/project-recipes/adf/flows/jira.yaml +12 -0
- package/project-recipes/adf/flows/mariadb.yaml +13 -0
- package/project-recipes/adf/flows/microsoft-365.yaml +19 -0
- package/project-recipes/adf/flows/microsoft-access.yaml +13 -0
- package/project-recipes/adf/flows/mongodb-atlas.yaml +12 -0
- package/project-recipes/adf/flows/mongodb.yaml +12 -0
- package/project-recipes/adf/flows/mysql.yaml +12 -0
- package/project-recipes/adf/flows/netezza.yaml +13 -0
- package/project-recipes/adf/flows/odata.yaml +12 -0
- package/project-recipes/adf/flows/odbc.yaml +13 -0
- package/project-recipes/adf/flows/oracle-cloud-storage.yaml +14 -0
- package/project-recipes/adf/flows/oracle.yaml +12 -0
- package/project-recipes/adf/flows/postgresql.yaml +18 -0
- package/project-recipes/adf/flows/presto.yaml +12 -0
- package/project-recipes/adf/flows/quickbooks.yaml +12 -0
- package/project-recipes/adf/flows/rest.yaml +21 -0
- package/project-recipes/adf/flows/s3-compatible.yaml +14 -0
- package/project-recipes/adf/flows/salesforce-service-cloud.yaml +12 -0
- package/project-recipes/adf/flows/salesforce.yaml +13 -0
- package/project-recipes/adf/flows/sap-bw-mdx.yaml +14 -0
- package/project-recipes/adf/flows/sap-bw-open-hub.yaml +13 -0
- package/project-recipes/adf/flows/sap-c4c.yaml +12 -0
- package/project-recipes/adf/flows/sap-ecc.yaml +13 -0
- package/project-recipes/adf/flows/sap-hana.yaml +14 -0
- package/project-recipes/adf/flows/sap-table.yaml +13 -0
- package/project-recipes/adf/flows/servicenow.yaml +12 -0
- package/project-recipes/adf/flows/sftp.yaml +14 -0
- package/project-recipes/adf/flows/sharepoint-online-list.yaml +12 -0
- package/project-recipes/adf/flows/shopify.yaml +12 -0
- package/project-recipes/adf/flows/snowflake.yaml +15 -0
- package/project-recipes/adf/flows/spark.yaml +12 -0
- package/project-recipes/adf/flows/sqlserver.yaml +12 -0
- package/project-recipes/adf/flows/square.yaml +13 -0
- package/project-recipes/adf/flows/sybase.yaml +13 -0
- package/project-recipes/adf/flows/teradata.yaml +12 -0
- package/project-recipes/adf/flows/vertica.yaml +12 -0
- package/project-recipes/adf/flows/web-table.yaml +14 -0
- package/project-recipes/adf/flows/xero.yaml +12 -0
- package/project-recipes/adf/platform.yaml +29 -0
- package/project-recipes/adf/project.yaml +10 -0
- package/project-recipes/adf/sample.yaml +3 -0
- package/project-recipes/adf/standard.yaml +15 -0
- 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/schemas/NOTICE.md +7 -0
- package/schemas/connection.schema.yaml +37 -0
- package/schemas/flow.schema.yaml +124 -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 -148
- 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 -226
- 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 -72
- package/build/cli/cli/plugin-resolution.js +0 -216
- 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 -415
- 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,12 @@
|
|
|
1
|
+
# PySpark
|
|
2
|
+
|
|
3
|
+
`monthly_revenue` is written in PySpark (`transform: { uses: pyspark }`).
|
|
4
|
+
[Its code](transforms/monthly_revenue.py) only defines
|
|
5
|
+
`transform(tables)`, which receives a DataFrame per input and returns the
|
|
6
|
+
result. The pack generates [a Python file](build/dev/src/subscriptions/silver/monthly_revenue.py)
|
|
7
|
+
that copies the code unchanged and wraps it as a materialised view with the
|
|
8
|
+
pipelines Python API (`from pyspark import pipelines as dp`): the full name,
|
|
9
|
+
comment and clustering from the definitions, and the checks as
|
|
10
|
+
`expect_all…` decorators.
|
|
11
|
+
|
|
12
|
+
The bronze table stays SQL; one pipeline runs both files.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
apiVersion: v3.1.0
|
|
2
|
+
kind: DataContract
|
|
3
|
+
id: billing.invoices
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
status: active
|
|
6
|
+
schema:
|
|
7
|
+
- name: invoices
|
|
8
|
+
logicalType: object
|
|
9
|
+
description: Invoices from the billing system.
|
|
10
|
+
properties:
|
|
11
|
+
- { name: invoice_id, logicalType: string, required: true, primaryKey: true }
|
|
12
|
+
- { name: customer_id, logicalType: string, required: true }
|
|
13
|
+
- { name: plan, logicalType: string }
|
|
14
|
+
- { name: amount, logicalType: number, physicalType: "DECIMAL(18,2)" }
|
|
15
|
+
- { name: status, logicalType: string }
|
|
16
|
+
- { name: issued_at, logicalType: timestamp }
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
apiVersion: v3.1.0
|
|
2
|
+
kind: DataContract
|
|
3
|
+
id: billing.monthly_revenue
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
status: active
|
|
6
|
+
schema:
|
|
7
|
+
- name: monthly_revenue
|
|
8
|
+
logicalType: object
|
|
9
|
+
description: Paid revenue and customers per month and plan.
|
|
10
|
+
properties:
|
|
11
|
+
- { name: month, logicalType: timestamp, required: true }
|
|
12
|
+
- { name: plan, logicalType: string }
|
|
13
|
+
- { name: revenue, logicalType: number, physicalType: "DECIMAL(18,2)" }
|
|
14
|
+
- { name: customers, logicalType: integer }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# A transform written in PySpark: the code is a function that receives a
|
|
2
|
+
# DataFrame per input and returns the result.
|
|
3
|
+
id: subscriptions
|
|
4
|
+
environments:
|
|
5
|
+
dev: {}
|
|
6
|
+
imports:
|
|
7
|
+
- standard.yaml
|
|
8
|
+
- connections/*.yaml
|
|
9
|
+
- flows/*.yaml
|
|
10
|
+
- transforms/*.yaml
|
|
11
|
+
- contracts/*.yaml
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from pyspark.sql import functions as F
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def transform(tables):
|
|
5
|
+
invoices = tables["invoices"]
|
|
6
|
+
return (
|
|
7
|
+
invoices.where(F.col("status") == "paid")
|
|
8
|
+
.groupBy(F.date_trunc("month", "issued_at").alias("month"), "plan")
|
|
9
|
+
.agg(F.sum("amount").alias("revenue"), F.countDistinct("customer_id").alias("customers"))
|
|
10
|
+
)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
apiVersion: ingestron.io/v1
|
|
2
|
+
kind: Transform
|
|
3
|
+
id: monthly_revenue
|
|
4
|
+
inputs: [invoices]
|
|
5
|
+
transform:
|
|
6
|
+
uses: pyspark
|
|
7
|
+
code: ${file:monthly_revenue.py}
|
|
8
|
+
contract: billing.monthly_revenue
|
|
9
|
+
expectations:
|
|
10
|
+
- { name: revenue_not_negative, check: revenue >= 0, action: fail }
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Retail example
|
|
2
|
+
|
|
3
|
+
A complete project: web shop files brought into bronze, orders kept current
|
|
4
|
+
from change records, and a silver table of daily sales.
|
|
5
|
+
|
|
6
|
+
| File | What it shows |
|
|
7
|
+
| ----------------------------- | ------------------------------------------------------------------ |
|
|
8
|
+
| `project.yaml` | Values that differ between `dev` and `prod` |
|
|
9
|
+
| `standard.yaml` | The organisation's catalog naming, quality and a fixed setting |
|
|
10
|
+
| `platform.yaml` | Workspace, identity, tags, permissions, schedule and notifications |
|
|
11
|
+
| `connections/shop.yaml` | A files source whose path differs per environment |
|
|
12
|
+
| `flows/shop.yaml` | Change data (`mode: upsert`), CSV options and an expectation |
|
|
13
|
+
| `transforms/daily_sales.yaml` | SQL in its own file, reading two flow tables |
|
|
14
|
+
| `contracts/*.yaml` | ODCS contracts: types, keys and descriptions |
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
pnpm ingestron plan --definitions examples/08-retail --out examples/08-retail/build
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The generated files for both environments are in [build/](build/).
|
|
21
|
+
For editor help, run `ingestron schemas` in this folder and add the printed
|
|
22
|
+
setting to VS Code.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
apiVersion: v3.1.0
|
|
2
|
+
kind: DataContract
|
|
3
|
+
id: shop.customers
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
status: active
|
|
6
|
+
schema:
|
|
7
|
+
- name: customers
|
|
8
|
+
logicalType: object
|
|
9
|
+
description: Web shop customers.
|
|
10
|
+
properties:
|
|
11
|
+
- { name: id, logicalType: integer, required: true, primaryKey: true }
|
|
12
|
+
- { name: email, logicalType: string, required: true }
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
apiVersion: v3.1.0
|
|
2
|
+
kind: DataContract
|
|
3
|
+
id: shop.daily_sales
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
status: active
|
|
6
|
+
schema:
|
|
7
|
+
- name: daily_sales
|
|
8
|
+
logicalType: object
|
|
9
|
+
description: Order totals per customer and day.
|
|
10
|
+
properties:
|
|
11
|
+
- {
|
|
12
|
+
name: email,
|
|
13
|
+
logicalType: string,
|
|
14
|
+
required: true,
|
|
15
|
+
primaryKey: true,
|
|
16
|
+
primaryKeyPosition: 1,
|
|
17
|
+
}
|
|
18
|
+
- { name: day, logicalType: date, required: true, primaryKey: true, primaryKeyPosition: 2 }
|
|
19
|
+
- { name: total, logicalType: number, physicalType: "DECIMAL(18,2)" }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
apiVersion: v3.1.0
|
|
2
|
+
kind: DataContract
|
|
3
|
+
id: shop.orders
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
status: active
|
|
6
|
+
schema:
|
|
7
|
+
- name: orders
|
|
8
|
+
logicalType: object
|
|
9
|
+
description: One row per order, kept current.
|
|
10
|
+
properties:
|
|
11
|
+
- { name: id, logicalType: integer, required: true, primaryKey: true }
|
|
12
|
+
- { name: customer_id, logicalType: integer, required: true }
|
|
13
|
+
- { name: ordered_at, logicalType: timestamp, required: true }
|
|
14
|
+
- { name: total, logicalType: number, physicalType: "DECIMAL(18,2)" }
|
|
15
|
+
- { name: updated_at, logicalType: timestamp, required: true }
|
|
16
|
+
- { name: op, logicalType: string }
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
apiVersion: ingestron.io/v1
|
|
2
|
+
kind: Flow
|
|
3
|
+
id: shop
|
|
4
|
+
description: Orders and customers from the web shop.
|
|
5
|
+
source: shop
|
|
6
|
+
tables:
|
|
7
|
+
orders:
|
|
8
|
+
object: orders
|
|
9
|
+
contract: shop.orders
|
|
10
|
+
store:
|
|
11
|
+
with: { mode: upsert, sequence_by: updated_at, delete_when: "op = 'D'", except_columns: [op] }
|
|
12
|
+
expectations:
|
|
13
|
+
- { name: positive_total, check: total >= 0 }
|
|
14
|
+
customers:
|
|
15
|
+
object: customers
|
|
16
|
+
contract: shop.customers
|
|
17
|
+
ingest:
|
|
18
|
+
with: { format: csv, options: { header: true } }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Where this project's assets go. Values differ per environment.
|
|
2
|
+
apiVersion: ingestron.io/v1
|
|
3
|
+
kind: Platform
|
|
4
|
+
id: lakehouse
|
|
5
|
+
workspace:
|
|
6
|
+
host: ${values.host}
|
|
7
|
+
run_as:
|
|
8
|
+
service_principal_name: 7f3c2a10-0000-4000-8000-000000000001
|
|
9
|
+
tags:
|
|
10
|
+
team: sales
|
|
11
|
+
environment: ${environment.name}
|
|
12
|
+
permissions:
|
|
13
|
+
- group_name: sales-engineers
|
|
14
|
+
level: CAN_MANAGE
|
|
15
|
+
- group_name: sales-analysts
|
|
16
|
+
level: CAN_VIEW
|
|
17
|
+
schedule:
|
|
18
|
+
cron: 0 0 5 * * ?
|
|
19
|
+
timezone: Pacific/Auckland
|
|
20
|
+
notifications:
|
|
21
|
+
on_failure: [sales-data@example.com]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
id: retail
|
|
2
|
+
name: Retail sales
|
|
3
|
+
values:
|
|
4
|
+
host: https://adb-1111111111111111.1.azuredatabricks.net
|
|
5
|
+
storage: abfss://landing@retaildev.dfs.core.windows.net
|
|
6
|
+
environments:
|
|
7
|
+
dev: {}
|
|
8
|
+
prod:
|
|
9
|
+
values:
|
|
10
|
+
host: https://adb-2222222222222222.2.azuredatabricks.net
|
|
11
|
+
storage: abfss://landing@retailprod.dfs.core.windows.net
|
|
12
|
+
imports:
|
|
13
|
+
- standard.yaml
|
|
14
|
+
- platform.yaml
|
|
15
|
+
- connections/*.yaml
|
|
16
|
+
- flows/*.yaml
|
|
17
|
+
- transforms/*.yaml
|
|
18
|
+
- contracts/*.yaml
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# How the organisation builds data products. Shared by every project.
|
|
2
|
+
apiVersion: ingestron.io/v1
|
|
3
|
+
kind: Standard
|
|
4
|
+
id: acme
|
|
5
|
+
packs: [databricks@1]
|
|
6
|
+
naming:
|
|
7
|
+
catalog: "{{ environment }}_sales"
|
|
8
|
+
quality:
|
|
9
|
+
required: drop
|
|
10
|
+
store:
|
|
11
|
+
settings:
|
|
12
|
+
streaming-table:
|
|
13
|
+
properties: { delta.enableChangeDataFeed: "true" }
|
|
14
|
+
fixed:
|
|
15
|
+
streaming-table: { cluster_by: auto }
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Used by `ingestron init --template retail`.
|
|
2
|
+
title: Retail
|
|
3
|
+
summary: "A complete project: files into bronze, orders kept current from change records, and daily sales in silver."
|
|
4
|
+
questions:
|
|
5
|
+
- value: host
|
|
6
|
+
ask: "Databricks workspace URL"
|
|
7
|
+
default: https://adb-1111111111111111.1.azuredatabricks.net
|
|
8
|
+
- value: storage
|
|
9
|
+
ask: "Storage account URL for the landing files"
|
|
10
|
+
default: abfss://landing@retaildev.dfs.core.windows.net
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Salesforce
|
|
2
|
+
|
|
3
|
+
Two Salesforce objects through a Unity Catalog connection. SaaS sources need
|
|
4
|
+
no gateway: [one ingestion pipeline](build/dev/resources/crm_salesforce_ingestion.pipeline.yml)
|
|
5
|
+
writes `accounts` and `opportunities`, keyed by `Id`, with only the
|
|
6
|
+
contract's fields.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
apiVersion: v3.1.0
|
|
2
|
+
kind: DataContract
|
|
3
|
+
id: crm.accounts
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
status: active
|
|
6
|
+
schema:
|
|
7
|
+
- name: accounts
|
|
8
|
+
logicalType: object
|
|
9
|
+
description: Salesforce accounts.
|
|
10
|
+
properties:
|
|
11
|
+
- { name: Id, logicalType: string, required: true, primaryKey: true }
|
|
12
|
+
- { name: Name, logicalType: string }
|
|
13
|
+
- { name: Industry, logicalType: string }
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
apiVersion: v3.1.0
|
|
2
|
+
kind: DataContract
|
|
3
|
+
id: crm.opportunities
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
status: active
|
|
6
|
+
schema:
|
|
7
|
+
- name: opportunities
|
|
8
|
+
logicalType: object
|
|
9
|
+
description: Salesforce opportunities.
|
|
10
|
+
properties:
|
|
11
|
+
- { name: Id, logicalType: string, required: true, primaryKey: true }
|
|
12
|
+
- { name: AccountId, logicalType: string }
|
|
13
|
+
- { name: Amount, logicalType: number }
|
|
14
|
+
- { name: StageName, logicalType: string }
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# SQL Server
|
|
2
|
+
|
|
3
|
+
The ERP database is reachable from the workspace over private networking
|
|
4
|
+
(`connectivity: workspace`), so the pack ingests it with Lakeflow Connect:
|
|
5
|
+
|
|
6
|
+
- [a gateway](build/prod/resources/erp_erp_gateway.pipeline.yml) that captures
|
|
7
|
+
changes continuously, with the cluster policy from the standard;
|
|
8
|
+
- [an ingestion pipeline](build/prod/resources/erp_erp_ingestion.pipeline.yml)
|
|
9
|
+
that writes `customers` (SCD type 1) and `invoices` (SCD type 2, from
|
|
10
|
+
`mode: history`), each with only its contract's columns;
|
|
11
|
+
- [our pipeline](build/prod/src/erp/silver/customer_balances.sql), whose
|
|
12
|
+
transform reads both, using the current invoice versions;
|
|
13
|
+
- [a job](build/prod/resources/erp_refresh.job.yml) that refreshes ingestion
|
|
14
|
+
first and our pipeline after it.
|
|
15
|
+
|
|
16
|
+
The Unity Catalog connection `erp_sqlserver_<environment>` must exist; the
|
|
17
|
+
definitions name it but hold no credentials.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
apiVersion: ingestron.io/v1
|
|
2
|
+
kind: Connection
|
|
3
|
+
id: erp
|
|
4
|
+
description: The ERP's SQL Server, reachable from the workspace through ExpressRoute.
|
|
5
|
+
connector: sqlserver
|
|
6
|
+
connectivity: workspace
|
|
7
|
+
settings:
|
|
8
|
+
uc_connection: erp_sqlserver_${environment.name} # created by an administrator beforehand
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
apiVersion: v3.1.0
|
|
2
|
+
kind: DataContract
|
|
3
|
+
id: erp.customer_balances
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
status: active
|
|
6
|
+
schema:
|
|
7
|
+
- name: customer_balances
|
|
8
|
+
logicalType: object
|
|
9
|
+
description: Open balance per customer.
|
|
10
|
+
properties:
|
|
11
|
+
- { name: customer_id, logicalType: integer, required: true, primaryKey: true }
|
|
12
|
+
- { name: name, logicalType: string }
|
|
13
|
+
- { name: balance, logicalType: number, physicalType: "DECIMAL(18,2)" }
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
apiVersion: v3.1.0
|
|
2
|
+
kind: DataContract
|
|
3
|
+
id: erp.customers
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
status: active
|
|
6
|
+
schema:
|
|
7
|
+
- name: customers
|
|
8
|
+
logicalType: object
|
|
9
|
+
description: ERP customers.
|
|
10
|
+
properties:
|
|
11
|
+
- { name: customer_id, logicalType: integer, required: true, primaryKey: true }
|
|
12
|
+
- { name: name, logicalType: string }
|
|
13
|
+
- { name: country, logicalType: string }
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
apiVersion: v3.1.0
|
|
2
|
+
kind: DataContract
|
|
3
|
+
id: erp.invoices
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
status: active
|
|
6
|
+
schema:
|
|
7
|
+
- name: invoices
|
|
8
|
+
logicalType: object
|
|
9
|
+
description: ERP invoices with every past version.
|
|
10
|
+
properties:
|
|
11
|
+
- { name: invoice_id, logicalType: integer, required: true, primaryKey: true }
|
|
12
|
+
- { name: customer_id, logicalType: integer, required: true }
|
|
13
|
+
- { name: amount, logicalType: number, physicalType: "DECIMAL(18,2)" }
|
|
14
|
+
- { name: status, logicalType: string }
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
apiVersion: ingestron.io/v1
|
|
2
|
+
kind: Flow
|
|
3
|
+
id: erp
|
|
4
|
+
source: erp
|
|
5
|
+
tables:
|
|
6
|
+
customers:
|
|
7
|
+
object: erp.dbo.Customers
|
|
8
|
+
contract: erp.customers
|
|
9
|
+
invoices:
|
|
10
|
+
object: erp.dbo.Invoices
|
|
11
|
+
contract: erp.invoices
|
|
12
|
+
ingest:
|
|
13
|
+
with: { mode: history } # keep every version of an invoice
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# A SQL Server database reached over private networking from the workspace,
|
|
2
|
+
# ingested with Lakeflow Connect, then summarised by our own pipeline.
|
|
3
|
+
id: erp
|
|
4
|
+
environments:
|
|
5
|
+
dev: {}
|
|
6
|
+
prod: {}
|
|
7
|
+
imports:
|
|
8
|
+
- standard.yaml
|
|
9
|
+
- platform.yaml
|
|
10
|
+
- connections/*.yaml
|
|
11
|
+
- flows/*.yaml
|
|
12
|
+
- transforms/*.yaml
|
|
13
|
+
- contracts/*.yaml
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Third-party schema
|
|
2
|
+
|
|
3
|
+
`odcs-v3.1.0.schema.json` is the Open Data Contract Standard v3.1.0 JSON
|
|
4
|
+
Schema, unchanged, from
|
|
5
|
+
<https://github.com/bitol-io/open-data-contract-standard> (`schema/`),
|
|
6
|
+
copyright the Bitol project contributors, licensed under the Apache License
|
|
7
|
+
2.0. Downloaded 2026-10-24.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
|
2
|
+
title: Connection
|
|
3
|
+
description: A source that flows read from.
|
|
4
|
+
type: object
|
|
5
|
+
additionalProperties: false
|
|
6
|
+
required: [apiVersion, kind, id, connector, connectivity]
|
|
7
|
+
properties:
|
|
8
|
+
apiVersion: { const: ingestron.io/v1, description: Always ingestron.io/v1. }
|
|
9
|
+
kind: { const: Connection, description: The document kind. }
|
|
10
|
+
id:
|
|
11
|
+
type: string
|
|
12
|
+
pattern: "^[a-z][a-z0-9_]*$"
|
|
13
|
+
description: Name that flows use in `source`.
|
|
14
|
+
examples:
|
|
15
|
+
- shop
|
|
16
|
+
description:
|
|
17
|
+
{
|
|
18
|
+
type: string,
|
|
19
|
+
description: "What this document is for, in a sentence.",
|
|
20
|
+
examples: [Files the web shop exports every hour.],
|
|
21
|
+
}
|
|
22
|
+
connector:
|
|
23
|
+
type: string
|
|
24
|
+
pattern: "^[a-z][a-z0-9-]*$"
|
|
25
|
+
description: Connector type, such as `files`. The pack lists which methods can read it.
|
|
26
|
+
examples:
|
|
27
|
+
- files
|
|
28
|
+
connectivity:
|
|
29
|
+
enum: [public, workspace, private]
|
|
30
|
+
enumDescriptions:
|
|
31
|
+
- The data platform reaches the source directly.
|
|
32
|
+
- The platform reaches it over private networking, such as ExpressRoute or a peered network.
|
|
33
|
+
- The platform cannot reach it; something inside the source's network must bring the data.
|
|
34
|
+
description: How the data platform reaches the source. Standards choose methods by this.
|
|
35
|
+
settings:
|
|
36
|
+
type: object
|
|
37
|
+
description: Connector settings, such as `path` for files. Write secrets as `${secret:…}`.
|