You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "dongjoon-hyun (via GitHub)" <gi...@apache.org> on 2026/09/14 04:09:33 UTC
[PR] [SPARK-59485] Use server-side aggregation for `DataFrame.count()` [spark-connect-swift]
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-59485] Use server-side aggregation for `DataFrame.count()` [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #566:
URL: https://github.com/apache/spark-connect-swift/pull/566#issuecomment-5660044896
Merged to main
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-59485] Use server-side aggregation for `DataFrame.count()` [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #566:
URL: https://github.com/apache/spark-connect-swift/pull/566#issuecomment-5660039720
Thank you, @viirya ~
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-59485] Use server-side aggregation for `DataFrame.count()` [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #566: [SPARK-59485] Use server-side aggregation for `DataFrame.count()`
URL: https://github.com/apache/spark-connect-swift/pull/566
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org