Apache Spark Connect Client for Golang

Clone this repo:
  1. ffd8320 Bump golang.org/x/oauth2 from 0.25.0 to 0.28.0 by dependabot[bot] · 5 weeks ago master
  2. 470dd16 Bump golang.org/x/net from 0.34.0 to 0.36.0 by dependabot[bot] · 5 weeks ago
  3. d2bbe50 Bump github.com/apache/arrow-go/v18 from 18.1.0 to 18.2.0 by dependabot[bot] · 5 weeks ago
  4. 6862163 Updating to Spark 3.5.5 by Martin Grund · 5 weeks ago
  5. 49e9aba Bump google.golang.org/protobuf from 1.36.4 to 1.36.5 by dependabot[bot] · 5 weeks ago

Apache Spark Connect Client for Golang

This project houses the experimental client for Spark Connect for Apache Spark written in Golang.

Current State of the Project

Currently, the Spark Connect client for Golang is highly experimental and should not be used in any production setting. In addition, the PMC of the Apache Spark project reserves the right to withdraw and abandon the development of this project if it is not sustainable.

Getting started

This section explains how to run Spark Connect Go locally.

Step 1: Install Golang: https://go.dev/doc/install.

Step 2: Ensure you have installed buf CLI installed, more info here

Step 3: Run the following commands to setup the Spark Connect client.

git clone https://github.com/apache/spark-connect-go.git
git submodule update --init --recursive

make gen && make test

Step 4: Setup the Spark Driver on localhost.

  1. Download Spark distribution (3.5.0+), unzip the package.

  2. Start the Spark Connect server with the following command (make sure to use a package version that matches your Spark distribution):

sbin/start-connect-server.sh --packages org.apache.spark:spark-connect_2.12:3.5.2

Step 5: Run the example Go application.

go run cmd/spark-connect-example-spark-session/main.go

Runnning Spark Connect Go Application in a Spark Cluster

To run the Spark Connect Go application in a Spark Cluster, you need to build the Go application and submit it to the Spark Cluster. You can find a more detailed example runner and wrapper script in the java directory.

See the guide here: Sample Spark-Submit Wrapper.

How to write Spark Connect Go Application in your own project

See Quick Start Guide

High Level Design

The overall goal of the design is to find a good balance of principle of the least surprise for develoeprs that are familiar with the APIs of Apache Spark and idiomatic Go usage. The high-level structure of the packages follows roughly the PySpark giudance but with Go idioms.

Contributing

Please review the Contribution to Spark guide for information on how to get started contributing to the project.