cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

JOIN Two Big Tables, each being some terabytes.

subhas_hati
New Contributor

What is the strategy for joinning two big tables, each being some terrabytes. 

1 REPLY 1

Alberto_Umana
Databricks Employee
Databricks Employee

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);

https://docs.databricks.com/en/sql/language-manual/sql-ref-syntax-qry-select-hints.html#join-hint-ty...