SparkConnect

0.6.0

Apache Spark Connect Client for Swift
apache/spark-connect-swift

What's New

0.6.0

2026-04-10T17:35:24Z

Apache Spark™ Connect Client for Swift language is a subproject of Apache Spark and aims to provide Swift implementation of Spark Connect. 0.6.0 is the sixth release of Apache Spark Connect for Swift client. This is still experimental.

Website

https://apache.github.io/spark-connect-swift/

Swift Package Index

https://swiftpackageindex.com/apache/spark-connect-swift

Documentation

https://swiftpackageindex.com/apache/spark-connect-swift/0.6.0/documentation/sparkconnect

Full Changelog

0.5.0...0.6.0

Resolved Issues

  • [SPARK-54095] Release Spark Connect Swift Client 0.6.0
  • [SPARK-55066] Use Spark 3.5.8 for Spark 3 integration tests
  • [SPARK-55101] Add Swift 6.3 build test CI
  • [SPARK-55195] Add MacOS integration test with Apache Spark 4.2.0-preview1
  • [SPARK-55316] Upgrade gRPC Swift NIO Transport to 2.4.1
  • [SPARK-55381] Use Spark 4.0.2 instead of 4.0.1
  • [SPARK-55418] Add create_spark_jira.py script
  • [SPARK-55426] Set strategy.max-parrallel to 20 for all GitHub Action jobs
  • [SPARK-55454] Use 4.2.0-preview2 for Spark 4.2 integration tests
  • [SPARK-55538] Add IDEs and MacOS settings to .gitignore
  • [SPARK-55542] Upgrade gRPC Swift Protobuf to 2.2.0
  • [SPARK-55544] Enable GitHub Issues feature
  • [SPARK-55564] Improve create_spark_jira.py to support -p to set the parent JIRA ID
  • [SPARK-55565] Upgrade FlatBuffers to v25.12.19-2026-02-06-03fffb2
  • [SPARK-55591] Revise subtask creating message
  • [SPARK-55632] Upgrade gRPC Swift NIO Transport to 2.4.2
  • [SPARK-55635] Improve create_spark_jira.py to support TYPE parameter -t
  • [SPARK-55642] Add connection timeout to JIRA client to prevent hanging and enable retries
  • [SPARK-55650] Improve create_spark_jira.py to support the version parameter
  • [SPARK-55759] Use ubuntu-slim for GitHub Actions license-check job
  • [SPARK-55797] Upgrade gRPC Swift NIO Transport to 2.4.3
  • [SPARK-55844] Upgrade Vapor to 4.121.3 in web example
  • [SPARK-55849] Add .claude to .gitignore
  • [SPARK-55895] Fix pi example to use n instead of n-1
  • [SPARK-55908] Rename SPARK_(SWIFT_APP -> APP) and SPARK_(SWIFT -> APP)_HOME
  • [SPARK-55956] Use 4.2.0-preview3 RC1 for Spark 4.2 integration tests
  • [SPARK-56036] Use 4.2.0-preview3 instead of RC1
  • [SPARK-56051] Upgrade grpc-swift-2 to 2.3.0
  • [SPARK-56052] Update Spark Connect-generated Swift source code with 4.2.0-preview3
  • [SPARK-56053] Upgrade gRPC Swift Protobuf to 2.2.1
  • [SPARK-56058] Import FoundationEssentials instead of Foundation if available
  • [SPARK-56059] Use ContinuousClock instead of DispatchTime
  • [SPARK-56061] Use integer arithmetic instead of ceil
  • [SPARK-56063] Improve Linux Support
  • [SPARK-56064] Use SystemPackage.FileDescriptor instead of FileHandle
  • [SPARK-56068] Use Date.FormatStyle instead of DateFormatter
  • [SPARK-56069] Use FileManager.default.temporaryDirectory instead of NSTemporaryDirectory
  • [SPARK-56070] Avoid NSString.expandingTildeInPath usage
  • [SPARK-56071] Avoid ObjCBool usage
  • [SPARK-56072] Use Decimal constructor instead of pow
  • [SPARK-56077] Upgrade gRPC Swift NIO Transport to 2.4.5
  • [SPARK-56079] Optimize pi example Docker image size
  • [SPARK-56082] Optimize spark-sql example Docker image size
  • [SPARK-56083] Add pyspark-connect example
  • [SPARK-56086] Use URL.homeDirectory for iOS
  • [SPARK-56090] Fix 64-byte alignment calculation in ArrowBuffer
  • [SPARK-56094] Support getOperationStatuses API
  • [SPARK-56095] Optimize app example Docker image size
  • [SPARK-56097] Optimize web example Docker image size
  • [SPARK-56106] Optimize stream example Docker image size
  • [SPARK-56109] Remove Super-Linter from GitHub Actions jobs
  • [SPARK-56110] Use Distroless images for Examples
  • [SPARK-56112] Update publish_image to cover all example images
  • [SPARK-56124] Sync docker-related GitHub Actions versions to the ASF approved patterns
  • [SPARK-56149] Upgrade gRPC Swift NIO Transport to 2.5.0
  • [SPARK-56150] Update README.md with the docker image sizes
  • [SPARK-56191] Upgrade gRPC Swift NIO Transport to 2.6.0
  • [SPARK-56196] Use official Swift 6.3 Docker image instead of nightly
  • [SPARK-56197] Use musl Static Linux SDK for Examples Docker images
  • [SPARK-56261] Use Xcode 26.4 in CIs
  • [SPARK-56263] Upgrade gRPC Swift NIO Transport to 2.6.1
  • [SPARK-56264] Use Swift 6.3 always in CIs
  • [SPARK-56265] Make Examples Docker image sizes up-to-date with the published images
  • [SPARK-56266] Migrate Examples to Swift 6.3
  • [SPARK-56288] Upgrade gRPC Swift NIO Transport to 2.6.2
  • [SPARK-56290] Rename build-macos-26-swift(62 -> 63) in CI
  • [MINOR] Add release version badge and link to README.md

Apache Spark Connect Client for Swift

Release GitHub Actions Build Swift Version Compatibility Platform Compatibility

Apache Spark™ Connect for Swift is a subproject of Apache Spark and aims to provide a modern Swift library to enable Swift developers to leverage the power of Apache Spark for distributed data processing, machine learning, and analytical workloads directly from their Swift applications. For example, a user can develop and ship a lightweight Swift-based SparkPi app.

Docker Image Size

Name Image Size
apache/spark:4.1.1-python3-based SparkPi Docker Image Size
pyspark-connect-based SparkPi Docker Image Size
Swift-based SparkPi Docker Image Size

Resources

Requirement

So far, this library project is tracking the upstream changes of Apache Arrow project's Swift-support.

How to use in your apps

Create a Swift project.

mkdir SparkConnectSwiftApp
cd SparkConnectSwiftApp
swift package init --name SparkConnectSwiftApp --type executable

Add SparkConnect package to the dependency like the following

$ cat Package.swift
import PackageDescription

let package = Package(
  name: "SparkConnectSwiftApp",
  platforms: [
    .macOS(.v15)
  ],
  dependencies: [
    .package(url: "https://github.com/apache/spark-connect-swift.git", branch: "main")
  ],
  targets: [
    .executableTarget(
      name: "SparkConnectSwiftApp",
      dependencies: [.product(name: "SparkConnect", package: "spark-connect-swift")]
    )
  ]
)

Use SparkSession of SparkConnect module in Swift.

$ cat Sources/main.swift

import SparkConnect

let spark = try await SparkSession.builder.getOrCreate()
print("Connected to Apache Spark \(await spark.version) Server")

let statements = [
  "DROP TABLE IF EXISTS t",
  "CREATE TABLE IF NOT EXISTS t(a INT) USING ORC",
  "INSERT INTO t VALUES (1), (2), (3)",
]

for s in statements {
  print("EXECUTE: \(s)")
  _ = try await spark.sql(s).count()
}
print("SELECT * FROM t")
try await spark.sql("SELECT * FROM t").cache().show()

try await spark.range(10).filter("id % 2 == 0").write.mode("overwrite").orc("/tmp/orc")
try await spark.read.orc("/tmp/orc").show()

await spark.stop()

Run your Swift application.

$ swift run
...
Connected to Apache Spark 4.1.1 Server
EXECUTE: DROP TABLE IF EXISTS t
EXECUTE: CREATE TABLE IF NOT EXISTS t(a INT) USING ORC
EXECUTE: INSERT INTO t VALUES (1), (2), (3)
SELECT * FROM t
+---+
|  a|
+---+
|  1|
|  3|
|  2|
+---+

+---+
| id|
+---+
|  6|
|  8|
|  4|
|  2|
|  0|
+---+

You can find more complete examples including Spark SQL REPL, Web Server and Streaming applications in the Examples directory.

This library also supports SPARK_REMOTE environment variable to specify the Spark Connect connection string in order to provide more options.

Description

  • Swift Tools 6.2.0
View More Packages from this Author

Dependencies

Last updated: Sun Apr 19 2026 22:33:28 GMT-0900 (Hawaii-Aleutian Daylight Time)