RussellSpitzer commented on a change in pull request #25348: 
[RFC][SPARK-28554][SQL] Adds a v1 fallback writer implementation for v2 data 
source codepaths
URL: https://github.com/apache/spark/pull/25348#discussion_r311230127
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/WriteToDataSourceV2Exec.scala
 ##########
 @@ -261,25 +281,26 @@ case class OverwriteByExpressionExec(
     table: SupportsWrite,
     deleteWhere: Array[Filter],
     writeOptions: CaseInsensitiveStringMap,
-    query: SparkPlan) extends V2TableWriteExec with BatchWriteHelper {
+    plan: LogicalPlan,
+    query: SparkPlan) extends SupportsV1Write with BatchWriteHelper {
 
   private def isTruncate(filters: Array[Filter]): Boolean = {
     filters.length == 1 && filters(0).isInstanceOf[AlwaysTrue]
   }
 
   override protected def doExecute(): RDD[InternalRow] = {
-    val batchWrite = newWriteBuilder() match {
+    newWriteBuilder() match {
+      case v1: V1WriteBuilder if isTruncate(deleteWhere) =>
+        writeWithV1(v1.buildForV1Write(), SaveMode.Overwrite, writeOptions)
 
 Review comment:
   Does it make sense to just do this but only if "deleteWhere") is empty?

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