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
12 changes: 12 additions & 0 deletions Sources/SparkConnect/ArrowArray.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import Foundation

/// @nodoc
public protocol ArrowArrayHolder {
var type: ArrowType { get }
var length: UInt { get }
Expand All @@ -28,6 +29,7 @@ public protocol ArrowArrayHolder {
var getArrowColumn: (ArrowField, [ArrowArrayHolder]) throws -> ArrowColumn { get }
}

/// @nodoc
public class ArrowArrayHolderImpl: ArrowArrayHolder {
public let data: ArrowData
public let type: ArrowType
Expand Down Expand Up @@ -121,6 +123,7 @@ public class ArrowArrayHolderImpl: ArrowArrayHolder {
}
}

/// @nodoc
public class ArrowArray<T>: AsString, AnyArray {
public typealias ItemType = T
public let arrowData: ArrowData
Expand Down Expand Up @@ -160,6 +163,7 @@ public class ArrowArray<T>: AsString, AnyArray {
}
}

/// @nodoc
public class FixedArray<T>: ArrowArray<T> {
public override subscript(_ index: UInt) -> T? {
if self.arrowData.isNull(index) {
Expand All @@ -171,6 +175,7 @@ public class FixedArray<T>: ArrowArray<T> {
}
}

/// @nodoc
public class StringArray: ArrowArray<String> {
public override subscript(_ index: UInt) -> String? {
let offsetIndex = MemoryLayout<Int32>.stride * Int(index)
Expand All @@ -197,6 +202,7 @@ public class StringArray: ArrowArray<String> {
}
}

/// @nodoc
public class BoolArray: ArrowArray<Bool> {
public override subscript(_ index: UInt) -> Bool? {
if self.arrowData.isNull(index) {
Expand All @@ -208,6 +214,7 @@ public class BoolArray: ArrowArray<Bool> {
}
}

/// @nodoc
public class Date32Array: ArrowArray<Date> {
public override subscript(_ index: UInt) -> Date? {
if self.arrowData.isNull(index) {
Expand All @@ -221,6 +228,7 @@ public class Date32Array: ArrowArray<Date> {
}
}

/// @nodoc
public class Date64Array: ArrowArray<Date> {
public override subscript(_ index: UInt) -> Date? {
if self.arrowData.isNull(index) {
Expand All @@ -234,9 +242,12 @@ public class Date64Array: ArrowArray<Date> {
}
}

/// @nodoc
public class Time32Array: FixedArray<Time32> {}
/// @nodoc
public class Time64Array: FixedArray<Time64> {}

/// @nodoc
public class BinaryArray: ArrowArray<Data> {
public struct Options {
public var printAsHex = false
Expand Down Expand Up @@ -279,6 +290,7 @@ public class BinaryArray: ArrowArray<Data> {
}
}

/// @nodoc
public class StructArray: ArrowArray<[Any?]> {
public private(set) var arrowFields: [ArrowArrayHolder]?
public required init(_ arrowData: ArrowData) throws {
Expand Down
1 change: 1 addition & 0 deletions Sources/SparkConnect/ArrowArrayBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import Foundation

/// @nodoc
public protocol ArrowArrayHolderBuilder {
func toHolder() throws -> ArrowArrayHolder
func appendAny(_ val: Any?)
Expand Down
1 change: 1 addition & 0 deletions Sources/SparkConnect/ArrowBuffer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import Foundation

/// @nodoc
public class ArrowBuffer {
static let minLength: UInt = 1 << 5
static let maxLength = UInt.max
Expand Down
1 change: 1 addition & 0 deletions Sources/SparkConnect/ArrowBufferBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import Foundation

/// @nodoc
public protocol ArrowBufferBuilder {
associatedtype ItemType
var capacity: UInt { get }
Expand Down
1 change: 1 addition & 0 deletions Sources/SparkConnect/ArrowData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import Foundation

/// @nodoc
public class ArrowData {
public let type: ArrowType
public let buffers: [ArrowBuffer]
Expand Down
1 change: 1 addition & 0 deletions Sources/SparkConnect/ArrowDecoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import Foundation

/// @nodoc
public class ArrowDecoder: Decoder {
var rbIndex: UInt = 0
var singleRBCol: Int = 0
Expand Down
1 change: 1 addition & 0 deletions Sources/SparkConnect/ArrowEncoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import Foundation

/// @nodoc
public class ArrowEncoder: Encoder {
public private(set) var builders = [String: ArrowArrayHolderBuilder]()
private var byIndex = [String]()
Expand Down
1 change: 1 addition & 0 deletions Sources/SparkConnect/ArrowReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import Foundation
let FILEMARKER = "ARROW1"
let CONTINUATIONMARKER = -1

/// @nodoc
public class ArrowReader { // swiftlint:disable:this type_body_length
private class RecordBatchData {
let schema: org_apache_arrow_flatbuf_Schema
Expand Down
1 change: 1 addition & 0 deletions Sources/SparkConnect/ArrowReaderHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import FlatBuffers
import Foundation

/// @nodoc
private func makeBinaryHolder(
_ buffers: [ArrowBuffer],
nullCount: UInt
Expand Down
2 changes: 2 additions & 0 deletions Sources/SparkConnect/ArrowSchema.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import Foundation

/// @nodoc
public class ArrowField {
public let type: ArrowType
public let name: String
Expand All @@ -29,6 +30,7 @@ public class ArrowField {
}
}

/// @nodoc
public class ArrowSchema {
public let fields: [ArrowField]
public let fieldLookup: [String: Int]
Expand Down
2 changes: 2 additions & 0 deletions Sources/SparkConnect/ArrowTable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import Foundation

/// @nodoc
public class ArrowColumn {
public let field: ArrowField
fileprivate let dataHolder: ChunkedArrayHolder
Expand All @@ -35,6 +36,7 @@ public class ArrowColumn {
}
}

/// @nodoc
public class ArrowTable {
public let schema: ArrowSchema
public var columnCount: UInt { return UInt(self.columns.count) }
Expand Down
9 changes: 9 additions & 0 deletions Sources/SparkConnect/ArrowType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,19 @@

import Foundation

/// @nodoc
public typealias Time32 = Int32
/// @nodoc
public typealias Time64 = Int64
/// @nodoc
public typealias Date32 = Int32
/// @nodoc
public typealias Date64 = Int64

func FlatBuffersVersion_23_1_4() { // swiftlint:disable:this identifier_name
}

/// @nodoc
public enum ArrowError: Error {
case none
case unknownType(String)
Expand Down Expand Up @@ -84,6 +89,7 @@ public enum ArrowTime64Unit {
case nanoseconds
}

/// @nodoc
public class ArrowTypeTime32: ArrowType {
let unit: ArrowTime32Unit
public init(_ unit: ArrowTime32Unit) {
Expand All @@ -103,6 +109,7 @@ public class ArrowTypeTime32: ArrowType {
}
}

/// @nodoc
public class ArrowTypeTime64: ArrowType {
let unit: ArrowTime64Unit
public init(_ unit: ArrowTime64Unit) {
Expand All @@ -122,6 +129,7 @@ public class ArrowTypeTime64: ArrowType {
}
}

/// @nodoc
public class ArrowNestedType: ArrowType {
let fields: [ArrowField]
public init(_ info: ArrowType.Info, fields: [ArrowField]) {
Expand All @@ -130,6 +138,7 @@ public class ArrowNestedType: ArrowType {
}
}

/// @nodoc
public class ArrowType {
public private(set) var info: ArrowType.Info
public static let ArrowInt8 = Info.primitiveInfo(ArrowTypeId.int8)
Expand Down
2 changes: 2 additions & 0 deletions Sources/SparkConnect/ArrowWriter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
import FlatBuffers
import Foundation

/// @nodoc
public protocol DataWriter {
var count: Int { get }
func append(_ data: Data)
}

/// @nodoc
public class ArrowWriter { // swiftlint:disable:this type_body_length
public class InMemDataWriter: DataWriter {
public private(set) var data: Data
Expand Down
4 changes: 4 additions & 0 deletions Sources/SparkConnect/ChunkedArray.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@

import Foundation

/// @nodoc
public protocol AnyArray {
var arrowData: ArrowData { get }
func asAny(_ index: UInt) -> Any?
var length: UInt { get }
}

/// @nodoc
public protocol AsString {
func asString(_ index: UInt) -> String
}

/// @nodoc
public class ChunkedArrayHolder {
public let type: ArrowType
public let length: UInt
Expand Down Expand Up @@ -93,6 +96,7 @@ public class ChunkedArrayHolder {
}
}

/// @nodoc
public class ChunkedArray<T>: AsString {
public let arrays: [ArrowArray<T>]
public let type: ArrowType
Expand Down
3 changes: 3 additions & 0 deletions Sources/SparkConnect/File_generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import FlatBuffers

/// @nodoc
public struct org_apache_arrow_flatbuf_Block: NativeStruct, Verifiable, FlatbuffersInitializable {

static func validateVersion() { FlatBuffersVersion_23_1_4() }
Expand Down Expand Up @@ -67,6 +68,7 @@ public struct org_apache_arrow_flatbuf_Block: NativeStruct, Verifiable, Flatbuff
}
}

/// @nodoc
public struct org_apache_arrow_flatbuf_Block_Mutable: FlatBufferObject {

static func validateVersion() { FlatBuffersVersion_23_1_4() }
Expand All @@ -83,6 +85,7 @@ public struct org_apache_arrow_flatbuf_Block_Mutable: FlatBufferObject {
/// ----------------------------------------------------------------------
/// Arrow File metadata
///
/// @nodoc
public struct org_apache_arrow_flatbuf_Footer: FlatBufferObject, Verifiable {

static func validateVersion() { FlatBuffersVersion_23_1_4() }
Expand Down
1 change: 1 addition & 0 deletions Sources/SparkConnect/FlightData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import Foundation

/// @nodoc
public class FlightData {
let flightData: Arrow_Flight_Protocol_FlightData
public var flightDescriptor: FlightDescriptor? {
Expand Down
1 change: 1 addition & 0 deletions Sources/SparkConnect/FlightDescriptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import Foundation

/// @nodoc
public class FlightDescriptor {
public enum DescriptorType {
case unknown
Expand Down
1 change: 1 addition & 0 deletions Sources/SparkConnect/MemoryAllocator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import Foundation

/// @nodoc
public class MemoryAllocator {
let alignment: Int
init(_ alignment: Int) {
Expand Down
8 changes: 8 additions & 0 deletions Sources/SparkConnect/Message_generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import FlatBuffers

/// @nodoc
public enum org_apache_arrow_flatbuf_CompressionType: Int8, Enum, Verifiable {
public typealias T = Int8
public static var byteSize: Int { return MemoryLayout<Int8>.size }
Expand Down Expand Up @@ -60,6 +61,7 @@ public enum org_apache_arrow_flatbuf_BodyCompressionMethod: Int8, Enum, Verifiab
/// Arrow implementations do not need to implement all of the message types,
/// which may include experimental metadata types. For maximum compatibility,
/// it is best to send data using RecordBatch
/// @nodoc
public enum org_apache_arrow_flatbuf_MessageHeader: UInt8, UnionEnum {
public typealias T = UInt8

Expand Down Expand Up @@ -89,6 +91,7 @@ public enum org_apache_arrow_flatbuf_MessageHeader: UInt8, UnionEnum {
/// For example, a List<Int16> with values `[[1, 2, 3], null, [4], [5, 6], null]`
/// would have {length: 5, null_count: 2} for its List node, and {length: 6,
/// null_count: 0} for its Int16 node, as separate FieldNode structs
/// @nodoc
public struct org_apache_arrow_flatbuf_FieldNode: NativeStruct, Verifiable, FlatbuffersInitializable
{

Expand Down Expand Up @@ -141,6 +144,7 @@ public struct org_apache_arrow_flatbuf_FieldNode: NativeStruct, Verifiable, Flat
/// For example, a List<Int16> with values `[[1, 2, 3], null, [4], [5, 6], null]`
/// would have {length: 5, null_count: 2} for its List node, and {length: 6,
/// null_count: 0} for its Int16 node, as separate FieldNode structs
/// @nodoc
public struct org_apache_arrow_flatbuf_FieldNode_Mutable: FlatBufferObject {

static func validateVersion() { FlatBuffersVersion_23_1_4() }
Expand All @@ -156,6 +160,7 @@ public struct org_apache_arrow_flatbuf_FieldNode_Mutable: FlatBufferObject {
/// Optional compression for the memory buffers constituting IPC message
/// bodies. Intended for use with RecordBatch but could be used for other
/// message types
/// @nodoc
public struct org_apache_arrow_flatbuf_BodyCompression: FlatBufferObject, Verifiable {

static func validateVersion() { FlatBuffersVersion_23_1_4() }
Expand Down Expand Up @@ -238,6 +243,7 @@ public struct org_apache_arrow_flatbuf_BodyCompression: FlatBufferObject, Verifi
/// A data header describing the shared memory layout of a "record" or "row"
/// batch. Some systems call this a "row batch" internally and others a "record
/// batch".
/// @nodoc
public struct org_apache_arrow_flatbuf_RecordBatch: FlatBufferObject, Verifiable {

static func validateVersion() { FlatBuffersVersion_23_1_4() }
Expand Down Expand Up @@ -398,6 +404,7 @@ public struct org_apache_arrow_flatbuf_RecordBatch: FlatBufferObject, Verifiable
/// There is one vector / column per dictionary, but that vector / column
/// may be spread across multiple dictionary batches by using the isDelta
/// flag
/// @nodoc
public struct org_apache_arrow_flatbuf_DictionaryBatch: FlatBufferObject, Verifiable {

static func validateVersion() { FlatBuffersVersion_23_1_4() }
Expand Down Expand Up @@ -485,6 +492,7 @@ public struct org_apache_arrow_flatbuf_DictionaryBatch: FlatBufferObject, Verifi
}
}

/// @nodoc
public struct org_apache_arrow_flatbuf_Message: FlatBufferObject, Verifiable {

static func validateVersion() { FlatBuffersVersion_23_1_4() }
Expand Down
Loading
Loading