brkyvz opened a new pull request #27677: [SPARK-30924][SQL] Add additional 
checks to Merge Into
URL: https://github.com/apache/spark/pull/27677
 
 
   ### What changes were proposed in this pull request?
   
   Merge Into is currently missing additional validation around:
   
    1. The lack of any WHEN statements
    2. The first WHEN MATCHED statement needs to have a condition if there are 
two WHEN MATCHED statements.
    3. Single use of UPDATE/DELETE
   
   This PR introduces these validations.
   (1) is required, because otherwise the MERGE statement is useless.
   (2) is required, because otherwise the second WHEN MATCHED condition becomes 
dead code
   (3) is up for debate, but the idea there is that a single expression should 
be sufficient to specify when you would like to update or delete your records. 
We restrict it for now to reduce surface area and ambiguity.
   
   ### Why are the changes needed?
   
   To ease DataSource developers when building implementations for MERGE
   
   ### Does this PR introduce any user-facing change?
   
   Adds additional validation checks
   
   ### How was this patch tested?
   
   Unit tests

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to