Skip to content
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

For the future: Remove KSparkSession using new context() #125

Open
Jolanrensen opened this issue Feb 15, 2022 · 1 comment
Open

For the future: Remove KSparkSession using new context() #125

Jolanrensen opened this issue Feb 15, 2022 · 1 comment

Comments

@Jolanrensen
Copy link
Collaborator

Jolanrensen commented Feb 15, 2022

https://github.com/Kotlin/KEEP/blob/master/proposals/context-receivers.md

Context receivers will allow functions like

@context(SparkSession)
inline fun <reified T> List<T>.toDS() = toDS(spark)

to function without needing a separate KSparkSession. It could maybe also help in other places! It's still experimental though.

@Jolanrensen
Copy link
Collaborator Author

Jolanrensen commented Feb 15, 2022

@asm0dey Pretty interesting idea indeed!
I got curious, so I removed KSparkSession using the new context receivers and while IntelliJ does not seem to agree, it does work!
You can have a look yourself and experiment if you're curious on my branch https://github.com/Jolanrensen/kotlin-spark-api/tree/1.6.20-M1

Edit: after a restart, IntelliJ agrees too XD What a fun new feature

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

No branches or pull requests

1 participant