-
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-50964][SQL] Use StaticInvoke to implement VariantGet
codegen
#49627
base: master
Are you sure you want to change the base?
Conversation
|
I have fixed it, and another benefit of it is that when the |
@@ -244,6 +272,24 @@ class VariantInRelation { | |||
// Rewrite the attribute in advance, rather than depending on the last branch to rewrite it. | |||
// Ww need to avoid the `v@StructPathToVariant(fields)` branch to rewrite the child again. | |||
GetStructField(rewriteAttribute(v), fields(RequestedVariantField(g))) | |||
case s @ StaticInvoke( |
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.
This is likely the most annoying part of RuntimeReplaceable
: pattern match becomes less intuitive.
Now I think it's probably better not to use RuntimeReplaceable
for expressions that need be matched post analysis, until we improve RuntimeReplaceable
to be replaced truly at runtime.
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.
Let's hold it first, and I'll try to investigate how to make a truly RuntimeReplaceable
(as we discussed privately, I think its idea is to only execute the replaced expression
at runtime
, while still maintaining it during the analysis and optimization stages, right?)
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.
Yes, that will be the best.
What changes were proposed in this pull request?
The pr aims to
StaticInvoke
to implementVariantGet
codegen.non-literal
paths inVariantGet
.Why are the changes needed?
Based on @cloud-fan's suggestion, using
StaticInvoke
to implementVariantGet
codegen, it can simplify the code.Does this PR introduce any user-facing change?
No.
How was this patch tested?
VariantSuite
,VariantExpressionSuite
Was this patch authored or co-authored using generative AI tooling?
No.