Transport
Defined in: spark-session.ts:36
The network seam between SparkSession and a Spark Connect server.
Runtime adapters (e.g. @spark-connect-js/node) implement this interface to
provide actual gRPC I/O, while @spark-connect-js/core stays platform-agnostic.
Most methods are optional: a minimal in-memory Transport for testing only
needs executePlan. A full runtime adapter implements them all.
Methods
Section titled “Methods”analyzePlan()?
Section titled “analyzePlan()?”optional analyzePlan(sessionId, request): Promise<Record<string, unknown>>;Defined in: spark-session.ts:79
Send an AnalyzePlan request (schema, explain, etc.) and return the response.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sessionId |
string |
request |
Record<string, unknown> |
Returns
Section titled “Returns”Promise<Record<string, unknown>>
close()?
Section titled “close()?”optional close(): void;Defined in: spark-session.ts:100
Close the underlying connection. Called from SparkSession.stop().
Returns
Section titled “Returns”void
config()?
Section titled “config()?”optional config(sessionId, operation): Promise<Record<string, unknown>>;Defined in: spark-session.ts:85
Get/set/unset runtime configuration via the Config RPC.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sessionId |
string |
operation |
Record<string, unknown> |
Returns
Section titled “Returns”Promise<Record<string, unknown>>
executeCommand()?
Section titled “executeCommand()?”optional executeCommand( sessionId, command,options?): Promise<void>;Defined in: spark-session.ts:45
Execute a command (write, createView, etc.) that returns no Arrow data.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sessionId |
string |
command |
Record<string, unknown> |
options? |
ExecuteOptions |
Returns
Section titled “Returns”Promise<void>
executeCommandResponses()?
Section titled “executeCommandResponses()?”optional executeCommandResponses( sessionId, command,options?): Promise<Record<string, unknown>[]>;Defined in: spark-session.ts:61
Execute a command and collect any non-Arrow result payloads from the
ExecutePlanResponse stream. Used by streaming commands (e.g.
WriteStreamOperationStart, StreamingQueryCommand) where the server
returns a structured result.
Each entry in the returned array is a JSON-like shape carrying a type
discriminator (e.g. "writeStreamOperationStartResult",
"streamingQueryCommandResult") plus the decoded payload fields.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sessionId |
string |
command |
Record<string, unknown> |
options? |
ExecuteOptions |
Returns
Section titled “Returns”Promise<Record<string, unknown>[]>
executeCommandStream()?
Section titled “executeCommandStream()?”optional executeCommandStream( sessionId, command,options?): AsyncIterable<Record<string, unknown>>;Defined in: spark-session.ts:72
Execute a command and yield decoded result frames as the server pushes them. For long-running subscriptions (e.g. the listener bus) where executeCommandResponses’ collect-and-return would never resolve.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sessionId |
string |
command |
Record<string, unknown> |
options? |
ExecuteOptions |
Returns
Section titled “Returns”AsyncIterable<Record<string, unknown>>
executePlan()
Section titled “executePlan()”executePlan( sessionId, plan,options?): AsyncIterable<Uint8Array<ArrayBufferLike>>;Defined in: spark-session.ts:38
Execute a plan and stream raw Arrow IPC buffers back to the client.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sessionId |
string |
plan |
LogicalPlan |
options? |
ExecuteOptions |
Returns
Section titled “Returns”AsyncIterable<Uint8Array<ArrayBufferLike>>
interrupt()?
Section titled “interrupt()?”optional interrupt(sessionId, request): Promise<string[]>;Defined in: spark-session.ts:94
Cancel running operations. Returns the operation IDs the server reports
as interrupted. The request shape is one of:
{ type: "all" }
{ type: "tag", tag: string }
{ type: "operationId", operationId: string }
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sessionId |
string |
request |
Record<string, unknown> |
Returns
Section titled “Returns”Promise<string[]>
releaseSession()?
Section titled “releaseSession()?”optional releaseSession(sessionId): Promise<void>;Defined in: spark-session.ts:97
Release server-side session state. Called from SparkSession.stop().
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sessionId |
string |
Returns
Section titled “Returns”Promise<void>