CREATE SINK insights.benchmark_twrr_by_asset_sink AS
SELECT
benchmark_id,
fact_date,
asset_id,
daily_subperiod_return
FROM insights.benchmark_twrr_by_asset_mv AS benchmark_twrr_by_asset_mv_next
WITH (
connector='postgres',
host='psql-nonprod-uae-derived.postgres.database.azure.com',
port='6432',
user='migration_user',
password='***',
database='alinma-int-insights-db',
table='benchmark_twrr_metrics_by_assets_ft',
schema='insights',
type='upsert',
force_compaction='true',
primary_key='benchmark_id,fact_date,asset_id'
)