HyukjinKwon commented on code in PR #59942:
URL: https://github.com/apache/spark/pull/59942#discussion_r4423360546


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/ffi/NativeDataSourceSuite.scala:
##########
@@ -911,6 +1162,49 @@ class NativeDataSourceSuite extends QueryTest with 
SharedSparkSession {
         "msg" -> "create failed with the error code 1."))
   }
 
+  nativeTest("reject a state returned more than once") {

Review Comment:
   Done in bcd6124 of #59931; this PR gets it with its next merge of #59931. 
With the new option `stateless`, the test library's `partitions`, 
`stream_partitions` and `create_writer` never call `set_state`:
   - `read` then fails unless it gets a state of length 0, and takes the 
columns from the schema to read.
   - A data writer that gets a state of length 0 passes its rows to `commit` in 
its message, and `commit` fails unless the messages have rows.
   
   The new test "read and write without a state" runs a batch read (also with 
pruned columns), a micro-batch read and a batch write in that mode, and checks 
their rows. The guide now also says that `read` and `create_data_writer` get an 
empty state when the reader or the writer has none.
   



-- 
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]

Reply via email to