Github user rdblue commented on a diff in the pull request:
https://github.com/apache/spark/pull/20752#discussion_r172616831
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/WriteToDataSourceV2.scala
---
@@ -54,7 +55,14 @@ case class WriteToDataSourceV2Exec(writer:
DataSourceWriter, query: SparkPlan) e
override protected def doExecute(): RDD[InternalRow] = {
val writeTask = writer match {
case w: SupportsWriteInternalRow =>
w.createInternalRowWriterFactory()
- case _ => new
InternalRowDataWriterFactory(writer.createWriterFactory(), query.schema)
+ case w: MicroBatchWriter =>
+ new StreamingInternalRowDataWriterFactory(w.createWriterFactory(),
query.schema)
+ case w: StreamWriter =>
+ new StreamingInternalRowDataWriterFactory(
+
w.createWriterFactory().asInstanceOf[StreamingDataWriterFactory[Row]],
--- End diff --
This will cause a cast exception, right? It think it is better to use a
separate create method.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]