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

   ### What changes were proposed in this pull request?
   
   [SPARK-61414](https://issues.apache.org/jira/browse/SPARK-61414): send a 
limit of one row over an empty projection in `DataFrame::is_empty` of the Rust 
API, as PySpark does.
   
   `DataFrame::is_empty` of the Rust API, and so `DataFrame.isEmpty` of the 
Python client, now sends `Limit(1)` over a `Project` with no expressions and 
checks whether a row comes back, as PySpark's `isEmpty` (`select().take(1)`) 
does. It sent a `count(1)` aggregate over `Limit(1)`.
   
   ### Why are the changes needed?
   
   The answers were the same, but the plan the server ran and the result it 
returned were not those of PySpark.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No change to the result. The request that `is_empty` and `isEmpty` send is 
now the one PySpark sends.
   
   ### How was this patch tested?
   
   - Rust: an offline test (`tests/is_empty_plan.rs`, an in-process gRPC stub 
that answers Config and ExecutePlan) of the relation of the request; it fails 
on master (an `Aggregate` is sent). A server-gated test (`e2e_dataframe.rs`) of 
the result for a non-empty and an empty DataFrame; it ran against a local OSS 
Spark 4.3.0 Connect server and passed.
   - Python: an offline test of the request relation with `mock_connect`. It 
fails against a build with the old `is_empty` (observed by rebuilding the 
drop-in with the old code) and passes with the fix.
   - Library tests: 599 passed, and the `apache-spark-connect-core` tests pass. 
Integration targets compile with and without `wasm-udf`. `cargo fmt --all 
--check` and `ruff check` pass. Python offline suites: 3115 passed, 8 skipped. 
Live Python suites: 281 passed, 1 skipped.
   - Against a local OSS Spark 4.3.0 Connect server, the plan is the same as 
`pyspark-client 4.3.0` sends.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Opus 5.5 and Claude Sonnet 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