Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ let package = Package(
.package(url: "https://github.com/grpc/grpc-swift-2.git", exact: "2.1.0"),
.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", exact: "2.1.1"),
.package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", exact: "2.2.0"),
.package(url: "https://github.com/google/flatbuffers.git", branch: "v25.2.10"),
.package(url: "https://github.com/google/flatbuffers.git", branch: "v25.9.23"),
],
targets: [
.target(
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ So far, this library project is tracking the upstream changes of [Apache Arrow](
- [gRPC Swift 2.1 (July 2025)](https://github.com/grpc/grpc-swift-2/releases/tag/2.1.0)
- [gRPC Swift Protobuf 2.1 (August 2025)](https://github.com/grpc/grpc-swift-protobuf/releases/tag/2.1.1)
- [gRPC Swift NIO Transport 2.2 (September 2025)](https://github.com/grpc/grpc-swift-nio-transport/releases/tag/2.2.0)
- [FlatBuffers v25.2.10 (February 2025)](https://github.com/google/flatbuffers/releases/tag/v25.2.10)
- [FlatBuffers v25.9.23 (September 2025)](https://github.com/google/flatbuffers/releases/tag/v25.9.23)
- [Apache Arrow Swift](https://github.com/apache/arrow-swift)

## How to use in your apps
Expand Down
16 changes: 4 additions & 12 deletions Sources/SparkConnect/ArrowReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,7 @@ public class ArrowReader { // swiftlint:disable:this type_body_length

offset += Int(MemoryLayout<UInt32>.size)
streamData = input[offset...]
let dataBuffer = ByteBuffer(
data: streamData,
allowReadingUnalignedBuffers: true)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let dataBuffer = ByteBuffer(data: streamData)
let message = org_apache_arrow_flatbuf_Message.getRootAsMessage(bb: dataBuffer)
switch message.headerType {
case .recordbatch:
Expand Down Expand Up @@ -324,9 +322,7 @@ public class ArrowReader { // swiftlint:disable:this type_body_length
let result = ArrowReaderResult()
let footerStartOffset = fileData.count - Int(footerLength + 4)
let footerData = fileData[footerStartOffset...]
let footerBuffer = ByteBuffer(
data: footerData,
allowReadingUnalignedBuffers: useUnalignedBuffers)
let footerBuffer = ByteBuffer(data: footerData)
let footer = org_apache_arrow_flatbuf_Footer.getRootAsFooter(bb: footerBuffer)
let schemaResult = loadSchema(footer.schema!)
switch schemaResult {
Expand Down Expand Up @@ -356,9 +352,7 @@ public class ArrowReader { // swiftlint:disable:this type_body_length
recordBatch.offset + (Int64(MemoryLayout<Int32>.size) * messageOffset)
let messageEndOffset = messageStartOffset + Int64(messageLength)
let recordBatchData = fileData[messageStartOffset..<messageEndOffset]
let mbb = ByteBuffer(
data: recordBatchData,
allowReadingUnalignedBuffers: useUnalignedBuffers)
let mbb = ByteBuffer(data: recordBatchData)
let message = org_apache_arrow_flatbuf_Message.getRootAsMessage(bb: mbb)
switch message.headerType {
case .recordbatch:
Expand Down Expand Up @@ -410,9 +404,7 @@ public class ArrowReader { // swiftlint:disable:this type_body_length
result: ArrowReaderResult,
useUnalignedBuffers: Bool = false
) -> Result<Void, ArrowError> {
let mbb = ByteBuffer(
data: dataHeader,
allowReadingUnalignedBuffers: useUnalignedBuffers)
let mbb = ByteBuffer(data: dataHeader)
let message = org_apache_arrow_flatbuf_Message.getRootAsMessage(bb: mbb)
switch message.headerType {
case .schema:
Expand Down
1 change: 1 addition & 0 deletions Sources/SparkConnect/Message_generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
// swiftformat:disable all

import FlatBuffers
import Common
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


/// @nodoc
public enum org_apache_arrow_flatbuf_CompressionType: Int8, Enum, Verifiable {
Expand Down
1 change: 1 addition & 0 deletions Sources/SparkConnect/Schema_generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
// swiftformat:disable all

import FlatBuffers
import Common

/// @nodoc
public enum org_apache_arrow_flatbuf_MetadataVersion: Int16, Enum, Verifiable {
Expand Down
1 change: 1 addition & 0 deletions Sources/SparkConnect/SparseTensor_generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
// swiftformat:disable all

import FlatBuffers
import Common

/// @nodoc
public enum org_apache_arrow_flatbuf_SparseMatrixCompressedAxis: Int16, Enum, Verifiable {
Expand Down