Adapt Canonical Party to the domain platform; add unit tests

Makes the blog-generated product run on the digital-core domain built from
semprini-data-domain, with the same changes the canonical template received:
- flink/job.sql connects to ods:5432/ods as postgres with ${ODS_PASSWORD},
  substituted by data-domain at submission, instead of the blog's credentials
- lakehouse/010_replication.sql uses the platform's `ods` sync group and grants
  the lake tables to ducklake_reader and ducklake_writer
- product.yaml sync group, odps.yaml access URLs (domain ports 20000-20003,
  management zone Apicurio on 8081), CLI names in comments

Adds tests/: the canonical template's generic unit tests and this product's
expectations.yaml (seed rows, 24 constraint rejections, 5 relationship
traversals, one inbound-to-tombstone round trip).

Verified on digital-core on 2026-09-18: 65 of 65 smoke checks, 100 unit tests
passing, and registered in OpenMetadata under the digital-core domain.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
paulandClaude Opus 5 committed 2026-09-18 00:14:36 +12:00
1 parent cfb32d2d1b
commit dd096ee4dc
18 files changed
+590 -93

No files matched your search

+66 -66
View File
@@ -1,4 +1,4 @@
-- Canonical Party: streaming job (Flink SQL, Flink 2.1).
-- Canonical Party: streaming job (Flink SQL, Flink 2.2).
-- Submitted by the platform CLI with `bin/sql-client.sh -f job.sql` on the jobmanager.
--
-- Per entity table, four Flink tables and two continuous INSERTs:
@@ -6,8 +6,8 @@
-- <table>_ods jdbc upserts inbound records into the ODS table by primary key
-- <table>_cdc postgres-cdc every change committed to the ODS table, however it arrived
-- <table>_outbound upsert-kafka Subscribe Output: compacted topic keyed by <table>_id, deletes as tombstones
-- Column lists match the ODS table (snake_case). Types follow the mapping table in template/README.md.
-- Requires the connector jars listed under "Platform prerequisites" in template/README.md.
-- Column lists match the ODS table (snake_case). Types follow the mapping table in canonical_data_product/README.md.
-- Requires the connector jars listed under "Platform prerequisites" in canonical_data_product/README.md.
-- Nine tables: with pg_duckpipe's two slots this job needs eleven replication slots on the ODS,
-- one more than max_replication_slots=10 allows; raise the limit before submitting it.
@@ -44,10 +44,10 @@ CREATE TABLE party_ods (
PRIMARY KEY (party_id) NOT ENFORCED
) WITH (
'connector' = 'jdbc',
'url' = 'jdbc:postgresql://postgres:5432/digital?stringtype=unspecified',
'url' = 'jdbc:postgresql://ods:5432/ods?stringtype=unspecified',
'table-name' = 'canonical_party.party',
'username' = 'semprini',
'password' = 'semprini'
'username' = 'postgres',
'password' = '${ODS_PASSWORD}'
);
CREATE TABLE party_cdc (
@@ -60,11 +60,11 @@ CREATE TABLE party_cdc (
PRIMARY KEY (party_id) NOT ENFORCED
) WITH (
'connector' = 'postgres-cdc',
'hostname' = 'postgres',
'hostname' = 'ods',
'port' = '5432',
'username' = 'semprini',
'password' = 'semprini',
'database-name' = 'digital',
'username' = 'postgres',
'password' = '${ODS_PASSWORD}',
'database-name' = 'ods',
'schema-name' = 'canonical_party',
'table-name' = 'party',
'slot.name' = 'canonical_party_party_flink',
@@ -127,10 +127,10 @@ CREATE TABLE address_ods (
PRIMARY KEY (address_id) NOT ENFORCED
) WITH (
'connector' = 'jdbc',
'url' = 'jdbc:postgresql://postgres:5432/digital?stringtype=unspecified',
'url' = 'jdbc:postgresql://ods:5432/ods?stringtype=unspecified',
'table-name' = 'canonical_party.address',
'username' = 'semprini',
'password' = 'semprini'
'username' = 'postgres',
'password' = '${ODS_PASSWORD}'
);
CREATE TABLE address_cdc (
@@ -147,11 +147,11 @@ CREATE TABLE address_cdc (
PRIMARY KEY (address_id) NOT ENFORCED
) WITH (
'connector' = 'postgres-cdc',
'hostname' = 'postgres',
'hostname' = 'ods',
'port' = '5432',
'username' = 'semprini',
'password' = 'semprini',
'database-name' = 'digital',
'username' = 'postgres',
'password' = '${ODS_PASSWORD}',
'database-name' = 'ods',
'schema-name' = 'canonical_party',
'table-name' = 'address',
'slot.name' = 'canonical_party_address_flink',
@@ -208,10 +208,10 @@ CREATE TABLE person_ods (
PRIMARY KEY (person_id) NOT ENFORCED
) WITH (
'connector' = 'jdbc',
'url' = 'jdbc:postgresql://postgres:5432/digital?stringtype=unspecified',
'url' = 'jdbc:postgresql://ods:5432/ods?stringtype=unspecified',
'table-name' = 'canonical_party.person',
'username' = 'semprini',
'password' = 'semprini'
'username' = 'postgres',
'password' = '${ODS_PASSWORD}'
);
CREATE TABLE person_cdc (
@@ -223,11 +223,11 @@ CREATE TABLE person_cdc (
PRIMARY KEY (person_id) NOT ENFORCED
) WITH (
'connector' = 'postgres-cdc',
'hostname' = 'postgres',
'hostname' = 'ods',
'port' = '5432',
'username' = 'semprini',
'password' = 'semprini',
'database-name' = 'digital',
'username' = 'postgres',
'password' = '${ODS_PASSWORD}',
'database-name' = 'ods',
'schema-name' = 'canonical_party',
'table-name' = 'person',
'slot.name' = 'canonical_party_person_flink',
@@ -283,10 +283,10 @@ CREATE TABLE company_ods (
PRIMARY KEY (company_id) NOT ENFORCED
) WITH (
'connector' = 'jdbc',
'url' = 'jdbc:postgresql://postgres:5432/digital?stringtype=unspecified',
'url' = 'jdbc:postgresql://ods:5432/ods?stringtype=unspecified',
'table-name' = 'canonical_party.company',
'username' = 'semprini',
'password' = 'semprini'
'username' = 'postgres',
'password' = '${ODS_PASSWORD}'
);
CREATE TABLE company_cdc (
@@ -300,11 +300,11 @@ CREATE TABLE company_cdc (
PRIMARY KEY (company_id) NOT ENFORCED
) WITH (
'connector' = 'postgres-cdc',
'hostname' = 'postgres',
'hostname' = 'ods',
'port' = '5432',
'username' = 'semprini',
'password' = 'semprini',
'database-name' = 'digital',
'username' = 'postgres',
'password' = '${ODS_PASSWORD}',
'database-name' = 'ods',
'schema-name' = 'canonical_party',
'table-name' = 'company',
'slot.name' = 'canonical_party_company_flink',
@@ -362,10 +362,10 @@ CREATE TABLE party_role_ods (
PRIMARY KEY (party_role_id) NOT ENFORCED
) WITH (
'connector' = 'jdbc',
'url' = 'jdbc:postgresql://postgres:5432/digital?stringtype=unspecified',
'url' = 'jdbc:postgresql://ods:5432/ods?stringtype=unspecified',
'table-name' = 'canonical_party.party_role',
'username' = 'semprini',
'password' = 'semprini'
'username' = 'postgres',
'password' = '${ODS_PASSWORD}'
);
CREATE TABLE party_role_cdc (
@@ -379,11 +379,11 @@ CREATE TABLE party_role_cdc (
PRIMARY KEY (party_role_id) NOT ENFORCED
) WITH (
'connector' = 'postgres-cdc',
'hostname' = 'postgres',
'hostname' = 'ods',
'port' = '5432',
'username' = 'semprini',
'password' = 'semprini',
'database-name' = 'digital',
'username' = 'postgres',
'password' = '${ODS_PASSWORD}',
'database-name' = 'ods',
'schema-name' = 'canonical_party',
'table-name' = 'party_role',
'slot.name' = 'canonical_party_party_role_flink',
@@ -437,10 +437,10 @@ CREATE TABLE customer_ods (
PRIMARY KEY (customer_id) NOT ENFORCED
) WITH (
'connector' = 'jdbc',
'url' = 'jdbc:postgresql://postgres:5432/digital?stringtype=unspecified',
'url' = 'jdbc:postgresql://ods:5432/ods?stringtype=unspecified',
'table-name' = 'canonical_party.customer',
'username' = 'semprini',
'password' = 'semprini'
'username' = 'postgres',
'password' = '${ODS_PASSWORD}'
);
CREATE TABLE customer_cdc (
@@ -452,11 +452,11 @@ CREATE TABLE customer_cdc (
PRIMARY KEY (customer_id) NOT ENFORCED
) WITH (
'connector' = 'postgres-cdc',
'hostname' = 'postgres',
'hostname' = 'ods',
'port' = '5432',
'username' = 'semprini',
'password' = 'semprini',
'database-name' = 'digital',
'username' = 'postgres',
'password' = '${ODS_PASSWORD}',
'database-name' = 'ods',
'schema-name' = 'canonical_party',
'table-name' = 'customer',
'slot.name' = 'canonical_party_customer_flink',
@@ -520,10 +520,10 @@ CREATE TABLE contact_address_ods (
PRIMARY KEY (contact_address_id) NOT ENFORCED
) WITH (
'connector' = 'jdbc',
'url' = 'jdbc:postgresql://postgres:5432/digital?stringtype=unspecified',
'url' = 'jdbc:postgresql://ods:5432/ods?stringtype=unspecified',
'table-name' = 'canonical_party.contact_address',
'username' = 'semprini',
'password' = 'semprini'
'username' = 'postgres',
'password' = '${ODS_PASSWORD}'
);
CREATE TABLE contact_address_cdc (
@@ -541,11 +541,11 @@ CREATE TABLE contact_address_cdc (
PRIMARY KEY (contact_address_id) NOT ENFORCED
) WITH (
'connector' = 'postgres-cdc',
'hostname' = 'postgres',
'hostname' = 'ods',
'port' = '5432',
'username' = 'semprini',
'password' = 'semprini',
'database-name' = 'digital',
'username' = 'postgres',
'password' = '${ODS_PASSWORD}',
'database-name' = 'ods',
'schema-name' = 'canonical_party',
'table-name' = 'contact_address',
'slot.name' = 'canonical_party_contact_address_flink',
@@ -601,10 +601,10 @@ CREATE TABLE party_role_contact_address_ods (
PRIMARY KEY (party_role_contact_address_id) NOT ENFORCED
) WITH (
'connector' = 'jdbc',
'url' = 'jdbc:postgresql://postgres:5432/digital?stringtype=unspecified',
'url' = 'jdbc:postgresql://ods:5432/ods?stringtype=unspecified',
'table-name' = 'canonical_party.party_role_contact_address',
'username' = 'semprini',
'password' = 'semprini'
'username' = 'postgres',
'password' = '${ODS_PASSWORD}'
);
CREATE TABLE party_role_contact_address_cdc (
@@ -615,11 +615,11 @@ CREATE TABLE party_role_contact_address_cdc (
PRIMARY KEY (party_role_contact_address_id) NOT ENFORCED
) WITH (
'connector' = 'postgres-cdc',
'hostname' = 'postgres',
'hostname' = 'ods',
'port' = '5432',
'username' = 'semprini',
'password' = 'semprini',
'database-name' = 'digital',
'username' = 'postgres',
'password' = '${ODS_PASSWORD}',
'database-name' = 'ods',
'schema-name' = 'canonical_party',
'table-name' = 'party_role_contact_address',
'slot.name' = 'canonical_party_party_role_contact_address_flink',
@@ -676,10 +676,10 @@ CREATE TABLE party_association_ods (
PRIMARY KEY (party_association_id) NOT ENFORCED
) WITH (
'connector' = 'jdbc',
'url' = 'jdbc:postgresql://postgres:5432/digital?stringtype=unspecified',
'url' = 'jdbc:postgresql://ods:5432/ods?stringtype=unspecified',
'table-name' = 'canonical_party.party_association',
'username' = 'semprini',
'password' = 'semprini'
'username' = 'postgres',
'password' = '${ODS_PASSWORD}'
);
CREATE TABLE party_association_cdc (
@@ -694,11 +694,11 @@ CREATE TABLE party_association_cdc (
PRIMARY KEY (party_association_id) NOT ENFORCED
) WITH (
'connector' = 'postgres-cdc',
'hostname' = 'postgres',
'hostname' = 'ods',
'port' = '5432',
'username' = 'semprini',
'password' = 'semprini',
'database-name' = 'digital',
'username' = 'postgres',
'password' = '${ODS_PASSWORD}',
'database-name' = 'ods',
'schema-name' = 'canonical_party',
'table-name' = 'party_association',
'slot.name' = 'canonical_party_party_association_flink',