leonwind commented on code in PR #57142:
URL: https://github.com/apache/spark/pull/57142#discussion_r3596133134


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -1154,6 +1154,8 @@ class Analyzer(
         // Thus, we need to look at the raw plan if `relation` is a temporary 
view.
         // unwrapRelationPlan also resolves V2TableReference nodes in temp 
view plans.
         unwrapRelationPlan(relation) match {
+          case v: View if i.replaceCriteriaOpt.exists(_.isReplaceWhere) =>

Review Comment:
   this is needed because before we re-factored `REPLACE WHERE` into 
`InsertIntoStatement`, it got rejected since it is a `v2WriteCommand` 
(`OverwriteByExpression`) and fails with the same 
`writeIntoViewNotAllowedError`. 
   
   So this additional guard is preserving the behavior of the refactor.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to