rdblue commented on a change in pull request #25115: [SPARK-28351][SQL] Support 
DELETE in DataSource V2
URL: https://github.com/apache/spark/pull/25115#discussion_r309796188
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceResolution.scala
 ##########
 @@ -296,6 +310,17 @@ case class DataSourceResolution(
       orCreate = replace.orCreate)
   }
 
+  private def convertDeleteFrom(
+      catalog: TableCatalog,
+      identifier: Identifier,
+      delete: DeleteFromStatement): DeleteFromTable = {
+    val relation = CatalogV2Util.loadTable(catalog, identifier)
+        
.map(DataSourceV2Relation.create).getOrElse(UnresolvedRelation(delete.tableName))
 
 Review comment:
   I don't think this should throw an exception. We want `CheckAnalysis` to do 
that. I also don't think this should resolve the relation because 
`ResolveTables` is responsible for that, to keep the lookup code in one place 
instead of adding it in lots of places.
   
   This should not call `loadTable` and should instead insert the 
`UnresolvedRelation` from the `getOrElse` case. Then `ResolveTables` will load 
the table and `CheckAnalysis` will throw an exception if the table isn't found.

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