-
Notifications
You must be signed in to change notification settings - Fork 35
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
Better UDF support #152
Better UDF support #152
Conversation
udfs can now be registered asNonDeterministic and asNonNullable
Created UserDefinedFunction and NamedUserDefinedFunction and 22 instances of each. udf() and udf.register() functions with/without name for lambda, function reference, functional value reference. .register() extension function in KSparkSession as well aggregatorOf() function and udaf(). Can also be done using udf.register()
Maybe a vararg typed udf as final one? |
…y udf (since only WrappedArrays are allowed in udfs anyways). Added TypedColumn.asWrappedArray() functions for list-likes
working on vararg udfs Vararg unwrapper for spark (wip)
…m kotlin makes OOM hell break loose.
…stead of selectTyped()
fixes overall tests, tests, tests (wip)
# Conflicts: # pom.xml
To do: Finish tests, add examples, add in wiki/readme, probably merge udt first since column functions are changed here as well. |
# Conflicts: # jupyter/src/main/kotlin/org/jetbrains/kotlinx/spark/api/jupyter/SparkIntegration.kt # kotlin-spark-api/3.2/src/main/kotlin/org/jetbrains/kotlinx/spark/api/SparkSession.kt
@asm0dey whenever you have time to check it :) |
// } | ||
// | ||
///** Creates delegate of [UDFRegistration]. Use like: | ||
// * ```kotlin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this file should be deleted
@@ -91,6 +51,7 @@ class UDFWrapper0(private val udfName: String) { | |||
* Registers the [func] with its [name] in [this]. | |||
*/ | |||
@OptIn(ExperimentalStdlibApi::class) | |||
@Deprecated("Use new UDF notation", ReplaceWith("this.register(name, func)"), DeprecationLevel.HIDDEN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this!
It's definitely 1.2.0, not 1.1.1 |
…ich will be deprecated
For future reference, these files were used to generate the UDFs: |
from issue: #143
One gotcha I noticed is that
won't work since
toNormalClass2
is never accessed, so the register function is not executed. A simpleval a = toNormalClass2
already fixes this, but it's not optimal...