Skip to content

feat(spark): make SparkSession optional #385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 11, 2025

Conversation

andrew-coleman
Copy link
Contributor

The ToLogicalPlan class constructor takes a SparkSession argument which must be supplied by the caller.
We can simplify the API by making this parameter optional, and defaulting to SparkSession.builder().getOrCreate(). The LocalFiles.scala test has been modified so that both usages get tested.
The need for this was triggered by invoking this API from Python code (pyspark). Passing the SparkSession object from python involves accessing internal handles, which doesn’t make for a good user experience.

The ToLogicalPlan class constructor takes a SparkSession
argument which must be supplied by the caller.
We can simplify the API by making this parameter optional,
and defaulting to `SparkSession.builder().getOrCreate()`.
The `LocalFiles.scala` test has been modified so that both
usages get tested.
The need for this was triggered by invoking this API from Python
code (pyspark).  Passing the SparkSession object from python
involves accessing internal handles, which doesn’t make for a
good user experience.
@Blizzara Blizzara merged commit b67599e into substrait-io:main Apr 11, 2025
12 checks passed
@andrew-coleman andrew-coleman deleted the api branch April 11, 2025 12:40
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