xianyinxin commented on a change in pull request #26167: [SPARK-28893][SQL] 
Support MERGE INTO in the parser and add the corresponding logical plan
URL: https://github.com/apache/spark/pull/26167#discussion_r341011389
 
 

 ##########
 File path: 
sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
 ##########
 @@ -219,6 +219,12 @@ statement
     | RESET                                                            
#resetConfiguration
     | DELETE FROM multipartIdentifier tableAlias whereClause?          
#deleteFromTable
     | UPDATE multipartIdentifier tableAlias setClause whereClause?     
#updateTable
+    | MERGE INTO target=multipartIdentifier targetAlias=tableAlias
+        USING (source=multipartIdentifier |
+          '(' sourceQuery=query')') sourceAlias=tableAlias
 
 Review comment:
   Yea, I also tried postgres and checked some docs but I didn't find any 
strong argue why we should/should not support cte in MERGE (MERGE was committed 
to pg code but later reverted due to some unknown reason). I think there's no 
bad to support this.
   
   I‘ll to add a case for this syntax.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to