The entry point to programming Spark with the DataFrame API over Spark Connect.
val spark = SparkSession.builder
.remote("sc://localhost:15002")
.appName("my-app")
.getOrCreate()
spark.range(10).filter(col("id") % 2 === 0).show()
spark.stop()
A session owns the SparkConnectClient, a monotonic plan-id allocator (so every relation is uniquely identifiable to the server), an Arrow allocator for decoding results, and the RuntimeConfig facade.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait AutoCloseableclass Objecttrait Matchableclass Any
Members list
Type members
Classlikes
Implicit conversions ($"col", Seq(...).toDF(...)); use import spark.implicits.*.
Implicit conversions ($"col", Seq(...).toDF(...)); use import spark.implicits.*.
Attributes
- Supertypes
- Self type
-
implicits.type
Value members
Concrete methods
Attributes
- Definition Classes
-
AutoCloseable
Starts a new independent session against the same endpoint (fresh server-side session).
Starts a new independent session against the same endpoint (fresh server-side session).
Attributes
Creates a new Spark Declarative Pipeline (a dataflow graph) in this session. Available on Spark 4.1 and later servers.
Creates a new Spark Declarative Pipeline (a dataflow graph) in this session. Available on Spark 4.1 and later servers.
Attributes
Returns a DataFrameReader that can be used to read non-streaming data as a DataFrame.
Returns a org.apache.spark.sql.streaming.DataStreamReader for reading streaming data.
The client session id (a UUID).
The client session id (a UUID).
Attributes
Make this the active session for the current thread.
Make this the active session for the current thread.
Attributes
Executes a SQL query with positional parameters bound into the query.
Executes a SQL query with positional parameters bound into the query.
Attributes
Executes a SQL query with named parameters bound into the query.
Executes a SQL query with named parameters bound into the query.
Attributes
Releases the server-side session resources and closes the channel.
Releases the server-side session resources and closes the channel.
Attributes
Returns a org.apache.spark.sql.streaming.StreamingQueryManager for this session.
The version of Spark on which the connected server is running.
The version of Spark on which the connected server is running.
Attributes
Concrete fields
Returns the org.apache.spark.sql.catalog.Catalog interface for this session.
Runtime configuration for Spark.
Runtime configuration for Spark.