gengliangwang commented on code in PR #60640:
URL: https://github.com/apache/spark/pull/60640#discussion_r4608974076
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/ffi/NativeDataSource.scala:
##########
@@ -1428,9 +1433,11 @@ private[ffi] object NativeTask {
* @param read whether the context is the one of a read, which the library
may use after the
* task ended: an engine may read the stream of a partition
then, and a thread that
* the task does not wait for may be in get_next once it
completes, as with
- * `PipedRDD`. `is_interrupted` then also reports that the task
failed or completed,
- * and the context does not keep the task alive. A data writer
only runs within its
- * task, whose kill `is_interrupted` reports. Outside of a task,
it reports nothing.
+ * `PipedRDD`. `is_interrupted` then also reports that the task
failed, or that it
+ * started to complete, which is when the task may wait for such
a thread, and the
Review Comment:
Done in 74f99b15fd4e: Reworded the `read` doc of `NativeTask.create` so it
names the thread that a completing task stops and waits for: one that reads its
input on its own, such as the writer of a pipelined Python UDF.
##########
sql/core/src/main/resources/org/apache/spark/sql/datasource/spark_datasource.h:
##########
@@ -542,7 +542,8 @@ typedef struct SparkDsCommitOffsetInfo {
* may get the stream from Spark, read it in the task that opened it and
release it later, and
* Spark itself may read a stream on a thread that the task does not wait for,
for example the one
* of a PipedRDD. The task stays valid until then too, and for a read,
is_interrupted then also
- * returns true once the task failed or completed, so the library may stop
reading then. Such an
+ * returns true once the task failed or starts to complete, when Spark may
wait for such a thread,
+ * and once Spark closes its reader during get_next, so the library may stop
reading then. Such an
Review Comment:
Done in 74f99b15fd4e: Reworded the `SparkDsTaskContext` comment so it says
Spark may stop and wait for another thread that reads the stream, such as the
writer of a pipelined Python UDF, and no longer refers back to the PipedRDD
thread.
--
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]