zsxwing opened a new pull request #31713:
URL: https://github.com/apache/spark/pull/31713


   ### What changes were proposed in this pull request?
   
   `ResolveInsertInto.staticDeleteExpression` should use 
`UnresolvedAttribute.quoted` to create the delete expression so that we will 
treat the entire `attr.name` as a column name.
   
   ### Why are the changes needed?
   
   When users use `dot` in a partition column name, queries like ```INSERT 
OVERWRITE $t1 PARTITION (`a.b` = 'a') (`c.d`) VALUES('b')``` is not working.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Without this test, the above query will throw
   ```
   [info]   org.apache.spark.sql.AnalysisException: cannot resolve '`a.b`' 
given input columns: [a.b, c.d];
   [info] 'OverwriteByExpression RelationV2[a.b#17, c.d#18] default.tbl, ('a.b 
<=> cast(a as string)), false
   [info] +- Project [a.b#19, ansi_cast(col1#16 as string) AS c.d#20]
   [info]    +- Project [cast(a as string) AS a.b#19, col1#16]
   [info]       +- LocalRelation [col1#16]
   ```
   
   With the fix, the query will run correctly.
   
   ### How was this patch tested?
   
   The new added test.


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



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

Reply via email to