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/03 04:13:42 UTC
[PR] [SPARK-59192] Avoid force casts in `DataFrame.collect` [spark-connect-swift]
dongjoon-hyun opened a new pull request, #506:
URL: https://github.com/apache/spark-connect-swift/pull/506
### What changes were proposed in this pull request?
This PR removes the force casts (`as!`) from `DataFrame.collect()` and `DataFrame.show(_:_:_:)`.
- Per-value casts (`int64`, `date32`) use `as?`, like their sibling branches.
- Per-column casts (`ArrowTypeTime64`, `ArrowTypeTimestamp`, `AsString` for `binary`/`struct`) throw `SparkConnectError.invalidArrowData`.
- `show(_:_:_:)` folds the `String` cast into its existing `guard`.
### Why are the changes needed?
A force cast traps and kills the process. Since these casts apply to Arrow data received from a server, unexpected data crashes the host application. Both methods already `throws`, so callers can handle the error instead.
### Does this PR introduce _any_ user-facing change?
Yes, only where it previously crashed: `int64`/`date32` cells become `nil`, and the other cases throw `SparkConnectError.invalidArrowData`. No change for valid Arrow data.
### How was this patch tested?
Pass the CIs and manual tests with `apache/spark:4.2.0` Spark Connect server.
```
swift build -c release
swift test --no-parallel -c release --filter "DataFrameTests|RowTests|CreateDataFrameTests|DataTypeTests"
```
### 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-59192] Avoid force casts in `DataFrame.collect` [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #506:
URL: https://github.com/apache/spark-connect-swift/pull/506#issuecomment-5520467768
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-59192] Avoid force casts in `DataFrame.collect` [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #506:
URL: https://github.com/apache/spark-connect-swift/pull/506#issuecomment-5520412489
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-59192] Avoid force casts in `DataFrame.collect` [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #506: [SPARK-59192] Avoid force casts in `DataFrame.collect`
URL: https://github.com/apache/spark-connect-swift/pull/506
--
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