HeartSaVioR commented on a change in pull request #35374:
URL: https://github.com/apache/spark/pull/35374#discussion_r799106086
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/connector/WriteDistributionAndOrderingSuite.scala
##########
@@ -712,15 +831,84 @@ class WriteDistributionAndOrderingSuite
}
}
+ private def checkMicroBatchWriteRequirements(
+ tableDistribution: Distribution,
+ tableOrdering: Array[SortOrder],
+ tableNumPartitions: Option[Int],
+ expectedWritePartitioning: physical.Partitioning,
+ expectedWriteOrdering: Seq[catalyst.expressions.SortOrder],
+ writeTransform: DataFrame => DataFrame = df => df,
+ outputMode: String = "append",
+ expectAnalysisException: Boolean = false): Unit = {
+
+ catalog.createTable(ident, schema, Array.empty, emptyProps,
tableDistribution,
+ tableOrdering, tableNumPartitions)
+
+ withTempDir { checkpointDir =>
+ val inputData = MemoryStream[(Long, String)]
+ val inputDF = inputData.toDF().toDF("id", "data")
+
+ val queryDF = outputMode match {
+ case "append" =>
+ inputDF
+ case "complete" =>
Review comment:
Let's address "update" mode as well; it's ill-defined
(SupportsStreamingUpdateAsAppend) but there are users tolerating the definition
due to the latency requirement.
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/connector/WriteDistributionAndOrderingSuite.scala
##########
@@ -712,15 +831,84 @@ class WriteDistributionAndOrderingSuite
}
}
+ private def checkMicroBatchWriteRequirements(
+ tableDistribution: Distribution,
+ tableOrdering: Array[SortOrder],
+ tableNumPartitions: Option[Int],
+ expectedWritePartitioning: physical.Partitioning,
+ expectedWriteOrdering: Seq[catalyst.expressions.SortOrder],
+ writeTransform: DataFrame => DataFrame = df => df,
+ outputMode: String = "append",
+ expectAnalysisException: Boolean = false): Unit = {
+
+ catalog.createTable(ident, schema, Array.empty, emptyProps,
tableDistribution,
+ tableOrdering, tableNumPartitions)
+
+ withTempDir { checkpointDir =>
+ val inputData = MemoryStream[(Long, String)]
+ val inputDF = inputData.toDF().toDF("id", "data")
+
+ val queryDF = outputMode match {
+ case "append" =>
+ inputDF
+ case "complete" =>
Review comment:
Let's address "update" mode as well; it's ill-defined (update as append)
but there are users tolerating the definition due to the latency requirement.
--
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]