CREATE SINK insights.benchmark_values_by_region_sink AS
SELECT
benchmark_id,
fact_date,
item_id AS region_label_id,
weight
FROM insights.benchmark_values_by_distribution_mv
WHERE
distribution_type = 'regions'
WITH (
connector='postgres',
host='psql-nonprod-uae-derived.postgres.database.azure.com',
port='6432',
user='migration_user',
password='***',
database='adib-int-insights-db',
table='benchmark_values_by_regions_ft',
schema='insights',
type='upsert',
force_compaction='true',
primary_key='benchmark_id,fact_date,region_label_id'
)