CREATE SINK insights.benchmark_twrr_by_currency_sink AS
SELECT
benchmark_id,
fact_date,
currency_code,
daily_subperiod_return
FROM insights.benchmark_twrr_by_currency_mv
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_twrr_metrics_by_currencies_ft',
schema='insights',
type='upsert',
force_compaction='true',
primary_key='benchmark_id,fact_date,currency_code'
)