dongjoon-hyun opened a new pull request, #468:
URL: https://github.com/apache/spark-connect-swift/pull/468
### What changes were proposed in this pull request?
This PR aims to support `SparkSession.createDataFrame(_:_:)` to create a
`DataFrame` from local Swift data with a DDL-formatted schema.
```swift
let df = try await spark.createDataFrame(
[[1, "Alice"], [2, "Bob"], [3, nil]], "id INT, name STRING")
```
The data is serialized into an `Apache Arrow` IPC stream via the in-tree
`ArrowWriter` and embedded into the plan as a `LocalRelation`. Supported types
are `BOOLEAN`, `TINYINT`, `SMALLINT`, `INT`, `BIGINT`, `FLOAT`, `DOUBLE`,
`STRING`, `BINARY`, `DATE`, and `TIMESTAMP`. `nil` is mapped to `NULL`. Data
larger than 128MiB throws the new `SparkConnectError.LocalRelationTooLarge`.
### Why are the changes needed?
Previously, there was no way to create a `DataFrame` from local Swift data.
This is one of the fundamental `SparkSession` APIs which all other Spark
Connect clients provide.
### Does this PR introduce _any_ user-facing change?
No. This is a new API addition.
### How was this patch tested?
Pass the CIs with the newly added `CreateDataFrameTests` test suite.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Fable 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]