-
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-23914][SQL][follow-up] refactor ArrayUnion #21937
Conversation
Test build #93840 has finished for PR 21937 at commit
|
738a4a0
to
f48dde0
Compare
Test build #94208 has finished for PR 21937 at commit
|
|$declareNullTrackVariables | ||
|int $size = 0; | ||
|$arrayBuilderClass $builder = | ||
| ($arrayBuilderClass)$arrayBuilder.make($arrayBuilderClassTag); |
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.
nit: new $arrayBuilderClass()
should work?
val openHashSet = classOf[OpenHashSet[_]].getName | ||
val classTag = s"scala.reflect.ClassTag$$.MODULE$$.$hsTypeName()" | ||
val hashSet = ctx.freshName("hashSet") | ||
val arrayBuilder = "scala.collection.mutable.ArrayBuilder" |
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.
nit: classOf[mutable.ArrayBuilder[_]].getName
?
I'll revisit after the conflict is fixed. |
I see. Now, I am rebasing and resolving conflicts. |
f48dde0
to
93ec9ec
Compare
val classTag = s"scala.reflect.ClassTag$$.MODULE$$.$hsTypeName()" | ||
val hashSet = ctx.freshName("hashSet") | ||
val arrayBuilder = classOf[mutable.ArrayBuilder[_]].getName | ||
val arrayBuilderClass = s"$arrayBuilder$$of$ptName" |
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 not needed any more?
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.
I think that we still need this to create an intermediate result array. The array is allocated at L3907 as other functions do.
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.
Oh, sorry, I misread.
Test build #94290 has finished for PR 21937 at commit
|
Test build #94304 has finished for PR 21937 at commit
|
LGTM. |
Thanks! merging to master. |
What changes were proposed in this pull request?
This PR refactors
ArrayUnion
based on this suggestion.boolean
ArrayBuilder
orArrayBuffer
How was this patch tested?
Existing tests