ReemaAlzaid commented on code in PR #13674:
URL: https://github.com/apache/gluten/pull/13674#discussion_r4668008609
##########
gluten-ut/spark35/src-delta/test/scala/org/apache/spark/sql/execution/datasources/GlutenDeltaNativePartitionWriteSuite.scala:
##########
@@ -158,4 +159,60 @@ class GlutenDeltaNativePartitionWriteSuite extends
GlutenQueryTest with SharedSp
}
}
}
+
+ for (partitioned <- Seq(false, true); nativeWrite <- Seq(false, true)) {
+ test(s"Delta streaming appends: partitioned=$partitioned,
nativeWrite=$nativeWrite") {
+ assume(BackendTestUtils.isVeloxBackendLoaded())
+ import testImplicits._
+ withSQLConf(
+ "spark.gluten.sql.columnar.backend.velox.delta.enableNativeWrite" ->
nativeWrite.toString,
+ "spark.databricks.delta.stats.collect" -> "false") {
+ withTempDir {
+ dir =>
+ val path = dir.getCanonicalPath + "/data"
+ val input = MemoryStream[(Option[Long], Option[String])]
+ val writer = input.toDF().toDF("id", "part")
+ .filter($"id".isNull || $"id" >= 0L)
+ .writeStream.format("delta").outputMode("append")
+ .option("checkpointLocation", dir.getCanonicalPath +
"/checkpoint")
+ val query = (if (partitioned) writer.partitionBy("part") else
writer).start(path)
+ try {
+ input.addData((Some(1L), Some("a")), (None, Some("a")))
+ query.processAllAvailable()
+ input.addData((Some(2L), None), (Some(3L), Some("b")))
+ query.processAllAvailable()
+ // Advance the source offset with an empty output batch.
+ input.addData((Some(-1L), Some("discarded")))
Review Comment:
Included the empty file fix from #13390 for Spark 3.5. I tested the
unpartitioned native write case with stats disabled, including an empty batch.
All 16 streaming test cases passed
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]