title: What is the pyspark equivalent of MERGE INTO for databricks delta lake?
body: <p>The databricks <a href="https://docs.databricks.com/spark/latest/spark-sql/language-manual/merge-into.html" rel="noreferrer">documentation</a> describes how to do a merge for delta-tables.</p>
  
  <p>In SQL the syntax</p>
  
  <pre><code>MERGE INTO [db_name.]target_table [AS target_alias]
  USING [db_name.]source_table [&lt;time_travel_version&gt;] [AS source_alias]
  ON &lt;merge_condition&gt;
  [ WHEN MATCHED [ AND &lt;condition&gt; ] THEN &lt;matched_action&gt; ]
  [ WHEN MATCHED [ AND &lt;condition&gt; ] THEN &lt;matched_action&gt; ]
  [ WHEN NOT MATCHED [ AND &lt;condition&gt; ]  THEN &lt;not_matched_action&gt; ]
  </code></pre>
  
  <p>can be used. Is a python-equivalent available?</p>