dongjoon-hyun opened a new pull request, #566: URL: https://github.com/apache/spark-connect-swift/pull/566
### What changes were proposed in this pull request? This PR aims to compute `DataFrame.count()` on the server side via `groupBy().count()`, like the Scala Spark Connect client. The previous client-side counting logic remains as an internal `executeAndCount()` for `Catalog` operations and `isEmpty()`. ### Why are the changes needed? To match [Dataset.count()](https://github.com/apache/spark/blob/v4.2.0/sql/connect/common/src/main/scala/org/apache/spark/sql/connect/Dataset.scala#L1041-L1043) of the Scala Spark Connect client in Apache Spark [v4.2.0](https://github.com/apache/spark/releases/tag/v4.2.0) (2026-07-11), and to avoid sending every row to the client just to count them. ### Does this PR introduce _any_ user-facing change? Yes. The results are the same, but the server now computes the count instead of sending every row to the client. As in the Scala client, the server can skip expressions that counting doesn't need. For example, `select(assert_true(lit(false))).count()` no longer raises an error. ### How was this patch tested? Pass the CIs with the newly added and updated test cases. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 5 -- 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]
