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

   ### What changes were proposed in this pull request?
   
   [SPARK-61041](https://issues.apache.org/jira/browse/SPARK-61041): the 
methods that take another DataFrame now check that it is of the same session, 
as PySpark Connect's `_check_same_session` does.
   
   These raise `SessionNotSameException` (`SESSION_NOT_SAME`) for a DataFrame 
of another session, and for anything that is not a DataFrame:
   - the DataFrame methods `join`, `crossJoin`, `lateralJoin`, `union`, 
`unionAll`, `unionByName`, `intersect`, `intersectAll`, `subtract`, 
`exceptAll`, `zip`, `nearestByJoin` and `sameSemantics`
   - `GroupedData.cogroup`
   - the `initialState` of `transformWithState` and `transformWithStateInPandas`
   
   `sameSemantics` first raises `NOT_EXPECTED_TYPE` for what is not a 
DataFrame, as PySpark's does.
   
   The core adds `GroupedData::spark_session`, the session of the grouped 
DataFrame.
   
   ### Why are the changes needed?
   
   The client took a DataFrame of another session and sent its plan to the 
server under this session. There, the relations of the other session, such as 
its temporary views, are not found. It also raised `TypeError`s for arguments 
that are not DataFrames.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. These methods raise the `SESSION_NOT_SAME` of PySpark 4.3.0.
   
   ### How was this patch tested?
   
   - A new live test checks that a join and a union with a DataFrame of a 
temporary view of another session raise `SessionNotSameException`. It passes 
with official PySpark 4.3.0, and fails without this change.
   - A new offline test checks the error of each of these methods, before any 
request, and that DataFrames of the same session are taken.
   - On a local server, 19 cases of these methods behave as in official PySpark 
4.3.0.
   - The lib tests of both crates (571 passed), the build of all tests, also 
with `wasm-udf`, the offline Python suites (1811 passed, 8 skipped), and the 
live drop-in and Arrow suites (109 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