rdblue commented on a change in pull request #25348: [SPARK-28554][SQL] Adds a
v1 fallback writer implementation for v2 data source codepaths
URL: https://github.com/apache/spark/pull/25348#discussion_r315451062
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/WriteToDataSourceV2Exec.scala
##########
@@ -173,12 +178,14 @@ case class ReplaceTableAsSelectExec(
Utils.tryWithSafeFinallyAndFailureCallbacks({
createdTable match {
case table: SupportsWrite =>
- val batchWrite = table.newWriteBuilder(writeOptions)
+ val writeBuilder = table.newWriteBuilder(writeOptions)
.withInputDataSchema(query.schema)
.withQueryId(UUID.randomUUID().toString)
- .buildForBatch()
- doWrite(batchWrite)
+ writeBuilder match {
+ case v1: V1WriteBuilder => writeWithV1(v1.buildForV1Write())
+ case v2 => doWrite(v2.buildForBatch())
Review comment:
Minor: Should we rename `doWrite` to `writeWithV2`?
----------------------------------------------------------------
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]