HyukjinKwon opened a new pull request, #350:
URL: https://github.com/apache/spark-connect-rust/pull/350

   ### What changes were proposed in this pull request?
   
   [SPARK-61151](https://issues.apache.org/jira/browse/SPARK-61151): The 
client's `pyspark.sql.streaming.listener` was its own rewrite of PySpark's: 699 
lines, of which most differ from PySpark 4.3.0's 1145. The module is pure 
Python and needs nothing of the client, so it is now PySpark 4.3.0's, vendored 
verbatim, and `check_vendored_upstream.sh` checks it.
   
   So, as PySpark's:
   - `StreamingQueryProgress.numInputRows`, `inputRowsPerSecond` and 
`processedRowsPerSecond` sum those of the sources when the JSON of the server 
leaves them out, as it does
   - the items of a progress, such as `progress["id"]`, are those of its JSON: 
a string, rather than a `uuid.UUID`
   - `StreamingQueryListener` has `spark` and `_set_spark_session`
   - `__all__` is `["StreamingQueryListener"]`
   
   The client builds the events and the progresses with their `fromJson`, which 
PySpark's module has too.
   
   ### Why are the changes needed?
   
   - `q.lastProgress.numInputRows` and `q.recentProgress[i].numInputRows` were 
`None`.
   - `lastProgress["id"] == q.id` was `False`, a `uuid.UUID` against a string.
   - A listener had no `spark`.
   
   Apache Spark's tests failed on this client:
   - `test_batch_dataframe_in_batch_session_sql_is_supported` and 
`test_batch_dataframe_join_in_batch_session_is_supported` of 
`test_parity_foreach_batch.py` (`'>' not supported between instances of 
'NoneType' and 'int'`)
   - `test_stream_status_and_progress`, `test_streaming_progress` and 
`test_streaming_query_functions_basic` of `test_parity_streaming.py` 
(`UUID(...) != '...'`)
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. The progresses, the events and the listeners of streaming queries are 
those of PySpark 4.3.0.
   
   ### How was this patch tested?
   
   - A new offline test parses the progress of the server, of two sources: its 
totals of rows and rates, those of the sources and the sink, the event of a 
progress, `__all__`, and the `spark` of a listener. It passes with official 
PySpark 4.3.0, and fails without this change.
   - A new live test checks that the progress of a `rate` query sums the rows 
and the rates of its sources. It fails without this change.
   - The progress of a `rate` query reads the same as with official PySpark 
4.3.0 (`numInputRows`, `inputRowsPerSecond`, `sources`, the keys of its JSON).
   - Apache Spark's `test_parity_streaming.py` runs on this client against a 
local server: 29 tests pass, and 1, `test_query_manager_no_recreation`, is 
fixed by SPARK-61162. Before this change, 4 failed. The two tests of 
`test_parity_foreach_batch.py` above pass.
   - The lib tests of both crates (596 passed), the build of all tests, also 
with `wasm-udf`, the offline Python suites (2213 passed, 8 skipped), and the 
live drop-in and Arrow suites (197 passed) and live cases (10 passed) against a 
local Spark 4.3.0 server. Clippy reports no diagnostics in the changed lines.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Opus 5.5
   
   This pull request and its description were written by Isaac.
   


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