stegus64
01/30/2026, 8:11 AMflarco
01/30/2026, 10:00 AMyaml
source: SQLSERVER
target: FABRIC
streams:
# recent mutable data - frequent updates
order_lines_recent:
sql: |
SELECT * FROM order_lines
WHERE created_at >= DATEADD(year, -1, GETDATE())
object: order_lines
mode: incremental
primary_key: [order_id, line_id]
update_key: updated_at
target_options:
delete_missing: soft # Handle deletes in recent data
# historical static data - one-time load
order_lines_historical:
sql: |
SELECT * FROM order_lines
WHERE created_at < DATEADD(year, -1, GETDATE())
object: order_lines_historical
mode: full-refresh
and then inside fabric, you can have a view: SELECT * FROM order_lines_recent UNION ALL SELECT * FROM order_lines_historical or just use a hook or something to create a final table.stegus64
01/30/2026, 11:14 AMstegus64
01/30/2026, 11:18 AMflarco
01/30/2026, 11:33 AMorder_lines - only holds recent/mutable data (with delete_missing)
- order_lines_historical - only holds historical/static data (no delete detection)
The delete_missing compares source PKs vs that specific target table's PKs - not across all tables. So historical data in order_lines_historical is completely isolated and won't be marked as deleted.
but thinking about it more, over time, they'd need to be a process to move data older than 1 year from order_lines to order_lines_historical, I think that's just an exra hook.flarco
01/30/2026, 11:33 AMstegus64
01/30/2026, 11:37 AMflarco
01/30/2026, 11:38 AMstegus64
01/30/2026, 11:45 AMflarco
01/30/2026, 11:55 AMyaml
delete_missing:
type: soft
where: created_at >= DATEADD(year, -1, GETDATE())
current way would still be accepted
yaml
delete_missing: hard
so, thinking through this, it would use this where clause on both side when comparing the PK:
- Source: SELECT pk FROM source WHERE {where}
- Target: SELECT pk FROM target WHERE {where}
so it compares apple-to-apple... am I missing anything?stegus64
01/30/2026, 12:12 PMflarco
01/30/2026, 12:14 PMstegus64
01/30/2026, 12:15 PMflarco
01/30/2026, 12:16 PMstegus64
01/30/2026, 12:16 PMflarco
01/30/2026, 12:16 PMstegus64
01/30/2026, 12:21 PMflarco
02/02/2026, 10:33 AMstegus64
02/03/2026, 3:21 PM