uros-b commented on code in PR #56319:
URL: https://github.com/apache/spark/pull/56319#discussion_r3466313555
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/state/StateDataSourceReadSuite.scala:
##########
@@ -329,6 +329,42 @@ class StateDataSourceNegativeTestSuite extends
StateDataSourceTestBase {
matchPVals = true)
}
}
+
+ test("SPARK-57225: statestore data source does not support write") {
+ withTempDir { tempDir =>
+ runLargeDataStreamingAggregationQuery(tempDir.getAbsolutePath)
+
+ val df = spark.read.format("statestore")
+ .option(StateSourceOptions.PATH, tempDir.getAbsolutePath)
+ .load()
+
+ val ex = intercept[StateDataSourceWriteUnsupported] {
+ df.write.format("statestore")
+ .option(StateSourceOptions.PATH, tempDir.getAbsolutePath)
+ .save()
+ }
+ checkError(ex, "STDS_WRITE_UNSUPPORTED", Some("0A000"),
+ Map("sourceName" -> "statestore"))
+ }
+ }
+
+ test("SPARK-57225: state-metadata data source does not support write") {
+ withTempDir { tempDir =>
+ runLargeDataStreamingAggregationQuery(tempDir.getAbsolutePath)
+
+ val df = spark.read.format("state-metadata")
+ .option(StateSourceOptions.PATH, tempDir.getAbsolutePath)
+ .load()
+
+ val ex = intercept[StateDataSourceWriteUnsupported] {
+ df.write.format("state-metadata")
+ .option(StateSourceOptions.PATH, tempDir.getAbsolutePath)
+ .save()
+ }
+ checkError(ex, "STDS_WRITE_UNSUPPORTED", Some("0A000"),
+ Map("sourceName" -> "state-metadata"))
+ }
+ }
}
Review Comment:
Noting a minor coverage gap: both tests supply a valid checkpoint PATH. A
write without a valid PATH throws first during getTable/inferSchema
(path-required / file-not-found for statestore), so STDS_WRITE_UNSUPPORTED is
not guaranteed in that path. Worth adding a negative test.
--
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]