-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-37019][SQL] Add codegen support to array transform #34294
Conversation
@@ -338,6 +390,68 @@ case class ArrayTransform( | |||
result | |||
} | |||
|
|||
override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = { |
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.
Some of this can probably be abstracted out into the parent traits, but I figured that will be easier to do when implementing a second function
Can one of the admins verify this patch? |
I have array filter working already too, just waiting for some feedback on this. |
Codegen example for
|
Already ran into an issue testing this out in a real use case where making it non-splittable caused a function to grow to big and revert back to interpreted, so I changed to just always use the atomic variable reference to read the value so it can be splittable. New sample codegen:
|
ping @viirya @HyukjinKwon since you two usually look at my PRs or might know the right other people to ping for thoughts :) |
Closing in favor of #34558 |
What changes were proposed in this pull request?
This PR adds codegen support to ArrayTransform. This is my first time playing around with codegen, so definitely looking for any feedback. I ran into several issues along the way which you'll see in some checks I had to add. Specifically:
Questions I have:
Why are the changes needed?
To improve performance of transform operations, letting the children be codegen'd and participate in WholeStageCodegen
Does this PR introduce any user-facing change?
No, only performance improvements.
How was this patch tested?
Existing unit tests, let me know if there's other codegen-specific unit tests I should add.