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

   ### What changes were proposed in this pull request?
   
   This PR aims to support `Decimal` properties in `createDataFrame` with 
`Encodable` types.
   
   - Write the Arrow `Decimal` schema in `ArrowWriterHelper`.
   - Add `Decimal128BufferBuilder` to store the unscaled value as a 128-bit 
integer, rounded `HALF_UP` like Spark.
   - Throw an error for values which do not fit in `DECIMAL(38, 18)`.
   
   ### Why are the changes needed?
   
   Currently, `createDataFrame` fails with `InvalidArrowData` for `Encodable` 
types with `Decimal` properties.
   
   ```swift
   struct D: Codable, Sendable { let v: Decimal }
   try await spark.createDataFrame([D(v: Decimal(string: "-1.5")!)])
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, `createDataFrame` now works with `Decimal` and `Decimal?` properties, 
matching the Scala `Dataset` behavior for `BigDecimal`.
   
   ### How was this patch tested?
   
   Pass the CIs with the newly added 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]

Reply via email to