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/08/04 17:59:24 UTC
[PR] [SPARK-58571] Support `TIME` type values in `DataFrame.collect` [spark-connect-swift]
dongjoon-hyun opened a new pull request, #481:
URL: https://github.com/apache/spark-connect-swift/pull/481
### What changes were proposed in this pull request?
This PR aims to support `TIME` type values in `DataFrame.collect` by introducing a new
`LocalTime` struct, following up SPARK-58568 which covered the schema path.
- A new public struct `LocalTime` represents a time of day without a date or a time zone,
like `java.time.LocalTime` of the Scala client and `datetime.time` of PySpark. It stores
`nanoOfDay` and exposes `hour`/`minute`/`second`/`nanosecond` components.
- `DataFrame.collect` now decodes Arrow `time64` columns into `LocalTime` values. Apache
Spark serializes `TIME(n)` columns as Arrow `time64(NANOSECOND)` regardless of precision.
- `Row.==` supports `LocalTime` value comparison.
No vendored `Arrow*.swift` file is touched; the Arrow layer already decodes `time64`.
### Why are the changes needed?
`DataFrame.collect` silently returned `nil` for every `TIME` column value because the
Arrow-to-Row conversion had no `time64` case and fell through to the `String` cast.
```swift
let df = try await spark.sql("SELECT TIME'12:34:56'")
try await df.collect() // Before: [Row(nil)]
// After: [Row(LocalTime(hour: 12, minute: 34, second: 56))]
```
### Does this PR introduce _any_ user-facing change?
Yes, `DataFrame.collect` returns `LocalTime` values instead of `nil` for `TIME` columns,
and a new public type `LocalTime` is added. This is a bug fix from the unreleased perspective.
### 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 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: 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-58571] Support `TIME` type values in `DataFrame.collect` [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #481:
URL: https://github.com/apache/spark-connect-swift/pull/481#issuecomment-5182848060
Thank you always, @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-58571] Support `TIME` type values in `DataFrame.collect` [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #481: [SPARK-58571] Support `TIME` type values in `DataFrame.collect`
URL: https://github.com/apache/spark-connect-swift/pull/481
--
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-58571] Support `TIME` type values in `DataFrame.collect` [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #481:
URL: https://github.com/apache/spark-connect-swift/pull/481#issuecomment-5183058302
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