Skip to content

Conversation

@rangadi
Copy link

@rangadi rangadi commented Jun 16, 2023

What changes were proposed in this pull request?

This adds SessionHolder rather than just SparkSession to SparkConnectPlanner. This is to allow access to session specific state at connect server level. Note that this is Spark-Connect specific session state, and is not stored with SparkSession.

E.g.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

  • Existing unit tests.

extends Exception(message, cause)

class SparkConnectPlanner(val session: SparkSession) extends Logging {
class SparkConnectPlanner(val sessionHolder: SessionHolder) extends Logging {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main change. The rest of the changes are consequence of API change.
@grundprinzip, @HyukjinKwon PTAL.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@HyukjinKwon HyukjinKwon Jun 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it needs some reviews @vicennial and/or @hvanhovell

Copy link
Contributor

@grundprinzip grundprinzip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this refactoring!


def transform(rel: proto.Relation): logical.LogicalPlan = {
new SparkConnectPlanner(spark).transformRelation(rel)
new SparkConnectPlanner(SessionHolder.forTesting(spark)).transformRelation(rel)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it!

@hvanhovell
Copy link
Contributor

Merging.

czxm pushed a commit to czxm/spark that referenced this pull request Jun 19, 2023
### What changes were proposed in this pull request?

This adds SessionHolder rather than just SparkSession to `SparkConnectPlanner`. This is to allow access to session specific state at connect server level. Note that this is Spark-Connect specific session state, and is not stored with SparkSession.

E.g.
  * Mapping from _dataframe reference id_ to actual dataframe in  apache#41580
  * File and archives stored with session in apache#41495

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
 - Existing unit tests.

Closes apache#41618 from rangadi/session-holder.

Authored-by: Raghu Angadi <[email protected]>
Signed-off-by: Herman van Hovell <[email protected]>
@juliuszsompolski
Copy link
Contributor

Thanks for the refactoring!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants