Skip to content
Merged
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 .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
with:
macos_exclude_xcode_versions: "[{\"xcode_version\": \"16.0\"}, {\"xcode_version\": \"16.1\"}, {\"xcode_version\": \"16.2\"}, {\"xcode_version\": \"16.3\"}]"
linux_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}, {\"swift_version\": \"6.0\"}, {\"swift_version\": \"6.1\"}, {\"swift_version\": \"nightly-main\"}, {\"swift_version\": \"nightly-6.1\"}]"
linux_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}, {\"swift_version\": \"6.0\"}, {\"swift_version\": \"6.1\"}, {\"swift_version\": \"nightly-main\"}, {\"swift_version\": \"nightly-6.1\"}, {\"swift_version\": \"nightly-6.3\"}]"
windows_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"6.0\"}, {\"swift_version\": \"6.1\"}, {\"swift_version\": \"nightly\"}, {\"swift_version\": \"nightly-6.1\"}]"
enable_macos_checks: false
enable_windows_checks: false
Expand Down
1 change: 0 additions & 1 deletion .swift-format-ignore

This file was deleted.

2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let package = Package(
dependencies: [
.package(
url: "https://github.com/google/flatbuffers.git",
exact: "25.2.10"
exact: "25.12.19"
),
.package(
url: "https://github.com/apple/swift-atomics.git",
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ The in-memory contiguous buffers allow constant-time random access to large, str

## Project status:

IPC serialization / deserialization has been tested against the Arrow integration testing JSON files, using the following strategy:
IPC deserialization has been tested against the Arrow integration testing JSON files (gold test files), using the following strategy:

1. Read the [Arrow cpp21 generated files](https://github.com/apache/arrow-testing/tree/master/data/arrow-ipc-stream/integration/cpp-21.0.0) into memory.
1. Read the Arrow integration test files into memory.
2. Encode the results to Codable & Equatable structs that can read and write the [test data format.](https://arrow.apache.org/docs/format/Integration.html#json-test-data-format).
3. Read the test JSON into the same Codable & Equatable struct and compare with the deserialized results,using Swift equality. This

Expand Down Expand Up @@ -125,7 +125,7 @@ typealias ArrowArrayUtf8 = ArrowArrayVariable<
FixedWidthBufferIPC<Int32>,
VariableLengthBufferIPC<String>
>
``
```

## Relationship to Arrow-Swift

Expand Down
2 changes: 1 addition & 1 deletion Scripts/flatc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/*

# Build FlatBuffers from source (ARM-compatible)
ENV FLATBUFFERS_VERSION=25.9.23
ENV FLATBUFFERS_VERSION=25.12.19
RUN git clone --depth 1 --branch v${FLATBUFFERS_VERSION} https://github.com/google/flatbuffers.git && \
cd flatbuffers && \
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release . && \
Expand Down
2 changes: 1 addition & 1 deletion Scripts/flatc/compile-flatbuffers.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
container run -v "$(pwd)":/src flatc File.fbs
container run -v "$(pwd)":/src flatc File.fbs Message.fbs Schema.fbs SparseTensor.fbs Tensor.fbs
7 changes: 4 additions & 3 deletions Scripts/readArrowIPC.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# Useful for debugging IPC writing issues.
import pyarrow as pa
import sys

import pyarrow as pa

print(f"PyArrow version: {pa.__version__}")

try:
with open(sys.argv[1], 'rb') as f:
reader = pa.ipc.open_file(f)
print(f"Schema: {reader.schema}")
print(f"Num batches: {reader.num_record_batches}")

for i in range(reader.num_record_batches):
batch = reader.get_batch(i)
print(f"Batch {i}: {batch.num_rows} rows, {batch.num_columns} columns")

print("✓ File read successfully")
except Exception as e:
print(f"✗ Error: {e}")
Expand Down
2 changes: 1 addition & 1 deletion Sources/Arrow/Array/Array.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ extension ArrowArrayBinaryView: StringArrayProtocol where ItemType == String {}
/// A type which provides access to arrays of `Data`, with opaque offset types.
///
/// The underlying array may have fixed or variable-length items.
protocol BinaryArrayProtocol: AnyArrowArrayProtocol {
public protocol BinaryArrayProtocol: AnyArrowArrayProtocol {
subscript(index: Int) -> Data? { get }
}
extension ArrowArrayFixedSizeBinary: BinaryArrayProtocol {}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Arrow/Array/ArrowColumn.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// limitations under the License.

public class ArrowColumn {
let dataHolder: any ChunkedArrayProtocol
public let dataHolder: any ChunkedArrayProtocol
public let field: ArrowField
public var length: Int { self.dataHolder.length }
public var nullCount: Int { self.dataHolder.nullCount }
Expand Down
2 changes: 1 addition & 1 deletion Sources/Arrow/ArrowError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public struct ArrowError: Error {
case outOfBounds(index: Int64)
case arrayHasNoElements
case unknownError(String)
case notImplemented
case notImplemented(String)
case ioError(String)
case invalid(String)
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/Arrow/ArrowType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ extension ArrowType {
@inlinable
public var isVariable: Bool {
switch self {
case .binary, .utf8: true
case .binary, .utf8, .largeBinary, .largeUtf8: true
default: false
}
}
Expand Down Expand Up @@ -963,7 +963,7 @@ extension ArrowType {
case .list(let field):
return "+l" + (try field.type.cDataFormatId)
default:
throw .init(.notImplemented)
throw .init(.notImplemented("cData not implmented for \(self)."))
}
}
}
Expand Down Expand Up @@ -1033,6 +1033,6 @@ extension ArrowType {
} else if from == "u" {
return .utf8
}
throw .init(.notImplemented)
throw .init(.notImplemented("cData not implmented for \(self)."))
}
}
3 changes: 1 addition & 2 deletions Sources/Arrow/Buffer/BinaryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
return view
}

/// Create a referenced view (for length > 12) - trivial!
/// Create a referenced view (for length > 12) .
public static func referenced(
length: Int32,
prefix: UInt32,
Expand All @@ -107,7 +107,6 @@
view.words[1] = Int32(bitPattern: prefix)
view.words[2] = bufferIndex
view.words[3] = offset

return view
}
}
39 changes: 39 additions & 0 deletions Sources/Arrow/Extensions.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright 2026 The Columnar Swift Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

extension ArrowField {

/// Return the GeoArrow extension type if set, else returns nil.
public var geoArrowType: GeoArrowType? {
metadata["ARROW:extension:name"].flatMap { GeoArrowType(rawValue: $0) }
}
}

/// The GeoArrow types.
///
/// Use these in conjunction with a column's `ArrowType` to interpret a geometry column. There are
/// multiple possible memory layouts for each type.
public enum GeoArrowType: String {
case point = "geoarrow.point"
case linestring = "geoarrow.linestring"
case polygon = "geoarrow.polygon"
case multipoint = "geoarrow.multipoint"
case multilinestring = "geoarrow.multilinestring"
case multipolygon = "geoarrow.multipolygon"
case geometry = "geoarrow.geometry"
case geometrycollection = "geoarrow.geometrycollection"
case box = "geoarrow.box"
case wkb = "geoarrow.wkb"
case wkt = "geoarrow.wkt"
}
152 changes: 0 additions & 152 deletions Sources/Arrow/Generated/File_generated.swift

This file was deleted.

35 changes: 0 additions & 35 deletions Sources/Arrow/Generated/FlatBuffersTypes.swift

This file was deleted.

Loading