SparkConnect

0.7.0

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

What's New

0.7.0

2026-07-25T20:31:59Z

Apache Spark™ Connect Client for Swift language is a subproject of Apache Spark and aims to provide Swift implementation of Spark Connect. 0.7.0 is the seventh 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.7.0/documentation/sparkconnect

Full Changelog

0.6.0...0.7.0

Resolved Issues

  • [SPARK-56380] Use 4.2.0-preview4 RC1 for Spark 4.2 integration tests
  • [SPARK-56419] Use consistent CaseInsensitiveDictionary initialization style
  • [SPARK-56420] Introduce toExpression method to deduplicate literal conversions
  • [SPARK-56421] Introduce IntervalType protocol for (DayTime|YearMonth)Interval
  • [SPARK-56422] Introduce createPlan method to deduplicate Plan creation pattern
  • [SPARK-56423] Remove manual Equatable implementation from StorageLevel
  • [SPARK-56425] Split DataFrame.swift into extension-based files
  • [SPARK-56432] Use 4.2.0-preview4 instead of RC1
  • [SPARK-56474] Rename create_spark_jira.py to create_jira_and_branch.py
  • [SPARK-56497] Upgrade the minimum Swift requirement to 6.3
  • [SPARK-56515] Upgrade grpc-swift-2 to 2.4.0
  • [SPARK-56516] Upgrade gRPC Swift Protobuf to 2.3.0
  • [SPARK-56517] Upgrade gRPC Swift NIO Transport to 2.7.0
  • [SPARK-56668] Upgrade actions/setup-java to v5
  • [SPARK-56709] Use Apache Spark 4.2.0-preview5 in CI
  • [SPARK-56722] Upgrade Docker GitHub Actions in publish_image.yml
  • [SPARK-56725] Upgrade Swift to 6.3.1
  • [SPARK-56753] Fix typos and code sample bugs in documentation
  • [SPARK-56788] Add integration-test-ubuntu-spark42 GitHub Actions job
  • [SPARK-56828] Upgrade grpc-swift-2 to 2.4.1
  • [SPARK-56857] Upgrade Swift to 6.3.2
  • [SPARK-56858] Use Xcode 26.5 in CIs
  • [SPARK-56950] Upgrade gRPC Swift Protobuf to 2.4.0
  • [SPARK-56951] Use 4.1.2 RC1 for Spark 4.1 integration tests
  • [SPARK-56996] Use Spark 4.1.2 instead of RC1
  • [SPARK-57007] Use Spark 4.1.2 in docs, examples, and tests
  • [SPARK-57008] Regenerate Spark Connect-generated Swift source code with protoc-gen-grpc-swift-2 2.4.0
  • [SPARK-57009] Add dev/spark_jira_utils.py
  • [SPARK-57010] Upgrade Iceberg to 1.11.0 in integration tests
  • [SPARK-57013] Drop Spark 3.5 Support
  • [SPARK-57014] Update Spark Connect-generated Swift source code with 4.2.0-preview5
  • [SPARK-57044] Support (create|drop)Database in Catalog
  • [SPARK-57045] Support drop(Table|View) in Catalog
  • [SPARK-57046] Support truncateTable in Catalog
  • [SPARK-57047] Support listViews in Catalog
  • [SPARK-57048] Add *.pyc and *.pyo to .gitignore
  • [SPARK-57049] Support listPartitions in Catalog
  • [SPARK-57050] Support getTableProperties in Catalog
  • [SPARK-57051] Support getCreateTableString in Catalog
  • [SPARK-57059] Add integration-test-mac-spark41-iceberg GitHub Actions job
  • [SPARK-57060] Support analyzeTable in Catalog
  • [SPARK-57061] Support xml(DataFrame) in DataFrameReader
  • [SPARK-57062] Support json(DataFrame) in DataFrameReader
  • [SPARK-57063] Support csv(DataFrame) in DataFrameReader
  • [SPARK-57084] Add geometry and geography SQL tests and answer files
  • [SPARK-57085] Support getFunction in Catalog
  • [SPARK-57086] Support recoverPartitions in Catalog
  • [SPARK-57087] Support listFunctions in Catalog
  • [SPARK-57090] Make Documentation up-to-date
  • [SPARK-57094] Use exact always instead of branch in Package.swift
  • [SPARK-57146] Add AGENTS.md and symlink CLAUDE.md to it
  • [SPARK-57151] Run CI in forked repositories and report build status to PRs
  • [SPARK-57156] Harden fork CI status workflows against run/check-run race and pagination
  • [SPARK-57279] Add SECURITY.md for scan-agent discoverability
  • [SPARK-57299] Upgrade Swift System to 1.6.5
  • [SPARK-57302] Support withColumn/withColumns for DataFrame
  • [SPARK-57304] Support na.(fill|drop|replace) for DataFrame
  • [SPARK-57305] Support stat.(cov|corr) for DataFrame
  • [SPARK-57306] Move DataFrameNaFunctions tests to new DataFrameNaFunctionsTests
  • [SPARK-57307] Support stat.crosstab for DataFrame
  • [SPARK-57308] Support stat.approxQuantile for DataFrame
  • [SPARK-57309] Support stat.sampleBy for DataFrame
  • [SPARK-57310] Support stat.freqItems for DataFrame
  • [SPARK-57311] Check the startup logs to make Iceberg integration tests robust
  • [SPARK-57312] Use 4.0.3 RC1 for Spark 4.0 integration tests
  • [SPARK-57333] Use 4.2.0 RC1 for Spark 4.2 integration tests
  • [SPARK-57334] Upgrade gRPC Swift NIO Transport to 2.8.0
  • [SPARK-57347] Remove spark.sql.geospatial.enabled=true from integration-test-mac-spark42
  • [SPARK-57357] Remove web example
  • [SPARK-57390] Use apache/spark:4.0.2-scala image in integration-test-ubuntu
  • [SPARK-57392] Use Apache Spark 4.0.3 in integration tests
  • [SPARK-57431] Upgrade Swift System to 1.7.2
  • [SPARK-57522] Update Spark Connect-generated Swift source code with 4.2.0-rc3
  • [SPARK-57541] Use 4.2.0 RC3 for Spark 4.2 integration tests
  • [SPARK-57542] Support nearestByJoin for DataFrame
  • [SPARK-57731] Upgrade gRPC Swift Protobuf to 2.4.1
  • [SPARK-57732] Upgrade grpc-swift-2 to 2.4.2
  • [SPARK-57733] Upgrade gRPC Swift NIO Transport to 2.9.0
  • [SPARK-57734] Use 4.2.0 RC4 for Spark 4.2 integration tests
  • [SPARK-57912] Improve connection string handling
  • [SPARK-57913] Use 4.2.0 RC5 for Spark 4.2 integration tests
  • [SPARK-57914] Pin apache/skywalking-eyes to v0.8.0 commit hash
  • [SPARK-57916] Add Security Best Practices documentation
  • [SPARK-57967] Upgrade Swift Docker image to 6.3.3
  • [SPARK-58048] Add Swift 6.4 build test CI
  • [SPARK-58051] Replace release-stripped asserts with runtime validation
  • [SPARK-58091] Upgrade swift-system to 1.7.4
  • [SPARK-58141] Use Apache Spark 4.2.0 for Spark 4.2 integration tests
  • [SPARK-58196] Use apache/spark:4.2.0-scala-java25 image in Spark 4.2 integration test
  • [SPARK-58198] Use Apache Spark 4.2.0 in README.md, Examples, and Examples.md
  • [SPARK-58254] Upgrade swift-system to 1.7.5

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.2.0-python3-based SparkPi Docker Image Size
pyspark-connect-based SparkPi Docker Image Size
Swift-based SparkPi Docker Image Size

Resources

Requirements

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.2.0 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 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.3.2
View More Packages from this Author

Dependencies

Last updated: Wed Sep 02 2026 20:02:27 GMT-0900 (Hawaii-Aleutian Daylight Time)