JOIN Two Big Tables, each being some terabytes.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 01:34 PM
What is the strategy for joinning two big tables, each being some terrabytes.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 01:47 PM
Hi @subhas_hati,
Enable AQE to dynamically optimize the join strategy at runtime based on the actual data distribution. This can help in choosing the best join strategy automatically
If you are using Delta tables, you can leverage the MERGE statement with schema evolution and other optimizations:
MERGE INTO target_table AS tgt
USING source_table AS src
ON tgt.key = src.key
WHEN MATCHED THEN UPDATE SET tgt.col1 = src.col1
WHEN NOT MATCHED THEN INSERT (key, col1) VALUES (src.key, src.col1);