Skip to content

feat(go): add a streaming Spark Connect client - #101

Open
HyukjinKwon wants to merge 4 commits into
adbc-drivers:mainfrom
HyukjinKwon:streaming-connect-client
Open

HyukjinKwon wants to merge 4 commits into
adbc-drivers:mainfrom
HyukjinKwon:streaming-connect-client

Conversation

@HyukjinKwon

@HyukjinKwon HyukjinKwon commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

This replaces the vendored spark-connect-go session behind the Connect backend with a small client in go/internal/connectimpl that streams results one Arrow batch at a time. On Connect, ExecuteQuery now reports -1 rows affected, and client_type changes from _SPARK_CONNECT_GO to adbc-driver-spark.

Part of #96.

This pull request and its description were written by Isaac.

@HyukjinKwon
HyukjinKwon force-pushed the streaming-connect-client branch from 829f4b8 to 1adf7c4 Compare October 12, 2026 07:26
HyukjinKwon and others added 2 commits October 13, 2026 09:08
Replace the vendored spark-connect-go session with a small gRPC client in
connectimpl. Each query is one ExecutePlan with a SQL relation root, and
results stream one Arrow batch at a time. Releasing a reader before the end
sends Interrupt for its operation, since Spark keeps running a
non-reattachable operation after its RPC is cancelled. Close bounds
ReleaseSession and always closes the channel, and the receive limit is
128 MiB. SQLSTATE now comes from any error with a SQLState method, so
sparkbase no longer imports connectclient.

Co-authored-by: Isaac <no-reply@databricks.com>
A reader stopped by its caller's context, or by an Arrow decode error,
left the Spark operation running: Release only interrupted readers that
had not hit any error. Track whether the server ended the operation
separately from whether the reader stopped reading.

Also restore the host and port checks spark-connect-go did before
dialing: reject an empty host and a port outside 0-65535, and keep
treating a missing or zero port as 15002.

Co-authored-by: Isaac <no-reply@databricks.com>
@HyukjinKwon
HyukjinKwon force-pushed the streaming-connect-client branch from 8839498 to 52f714f Compare October 13, 2026 00:12
@HyukjinKwon
HyukjinKwon marked this pull request as ready for review October 13, 2026 00:12
Drop the tests that ran the client against an in-process fake Spark
Connect server, and keep the ones that need no server. Add validation
tests that run against Spark: a row over gRPC's default 4 MiB limit, a
result of several Arrow batches, and the status and SQLSTATE of a query
on a missing table. The timeouts no longer need to be variables.

Co-authored-by: Isaac <no-reply@databricks.com>
Ruff's newer releases flag the nested with statements.

Co-authored-by: Isaac <no-reply@databricks.com>
@lidavidm

Copy link
Copy Markdown
Contributor

@HyukjinKwon sorry for the delay, this is in my queue, but the ADBC release and some other tasks are taking priority for me right now

This branch is waiting to be deployed

1 waiting deployment
aws-emr-serverless — 53d511dd Waiting Oct 15, 2026 by HyukjinKwon via Validate spark emr_8.0-connect/linux_amd64 #256
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants