← 输入框|github.com|刷新
Skip to content

Make Polynote compatible with Spark 3.3 - #1370

Open
rabejens wants to merge 2 commits into
polynote:masterfrom
rabejens:spark-3.3
Open

rabejens wants to merge 2 commits into
polynote:masterfrom
rabejens:spark-3.3

Conversation

@rabejens

Copy link
Copy Markdown

These are some small fixes to be compatible with Spark 3.3.

Spark 3.3 is built against Scala 2.12.15 and 2.13.8. Especially for the Scala 2.12 version, this is a breaking change because some serialVersionUids changed.

The SparkSession in Python does not have the SQLContext stored in spark._wrapped, so it is now explicitly created. Also, there is an additional import required for some PySpark functionality to work correctly.

@jeremyrsmith

Copy link
Copy Markdown
Contributor

@rabejens Are all these changes backward-compatible with prior Spark versions?

@rabejens

rabejens commented Nov 30, 2022 •

Copy link
Copy Markdown
Author

Unfortunately no, because there are some internal changes in the underlying scala, so a driver started in Scala 2.12.12 which is originally used in Polynote won't work with the Scala 2.12.15 used in Spark 3.2 and 3.3.

We either must compile Spark from source with the older Scala (if this is possible) or have separate versions of Polynote.

@jeremyrsmith

Copy link
Copy Markdown
Contributor

@rabejens

I'm not sure I totally grasp how 2.12.12 -> 2.12.15 could cause incompatibility from Polynote's perspective.

Let's say we release the changes here. What issues would we see when using, say, Spark 3.0? It seems like, assuming the kernel/driver (under spark-submit) boots up with the proper Scala library version for the Spark version you're using, everything would work fine. No?

so a driver started in Scala 2.12.12 which is originally used in Polynote won't work with the Scala 2.12.15 used in Spark 3.2 and 3.3

This is where I'm confused – when would this happen? If the driver starts with Scala 2.12.12, then it's on a previous Spark version which uses 2.12.12. As long as the driver and executors are using the same Scala version, the serialVersionUid shouldn't be an issue.

@rabejens

Copy link
Copy Markdown
Author

This is where I'm confused – when would this happen? If the driver starts with Scala 2.12.12, then it's on a previous Spark version which uses 2.12.12. As long as the driver and executors are using the same Scala version, the serialVersionUid shouldn't be an issue.

this is correct, you could also build a newer Spark from source using the appropriate Scala version.

I will try building a Spark 3.3 with Scala 2.12.12 to see how it turns out.

@jbguerraz

jbguerraz commented Mar 7, 2023 •

Copy link
Copy Markdown
Contributor

Just seen this PR...
I've opened this one #1387 for the same need: get polynote work with spark 3.3
The sqlcontext change is enough as far as we've seen (SQLContext._get_or_create(sc) is enough)

This branch has not been deployed

No deployments
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.

3 participants