dongjoon-hyun opened a new pull request, #409:
URL: https://github.com/apache/spark-connect-swift/pull/409

   [SPARK-XXXXX] Support `stat.crosstab` for `DataFrame`
   
   ### What changes were proposed in this pull request?
   
   This PR aims to support `crosstab` for `DataFrame` by wiring the 
`StatCrosstab`
   Spark Connect relation through `DataFrameStatFunctions`, exposed via
   `DataFrame.stat` like PySpark/Scala.
   
   ```swift
   public func crosstab(_ col1: String, _ col2: String) async throws -> 
DataFrame
   ```
   
   Unlike `stat.cov`/`stat.corr` which return a `Double`, `crosstab` returns a
   `DataFrame` (a contingency table): the first column is named `<col1>_<col2>` 
and
   holds the distinct values of `col1`, while the remaining column names are the
   distinct values of `col2`.
   
   ### Why are the changes needed?
   
   To improve API coverage by mirroring PySpark/Scala `DataFrameStatFunctions`.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, this PR adds a new API, `DataFrame.stat.crosstab`.
   
   ### How was this patch tested?
   
   Pass the CIs.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 4.8)


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