-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-23912][SQL][Followup] Refactor ArrayDistinct #22044
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
Conversation
|
Test build #94450 has finished for PR 22044 at commit
|
|
retest this please |
|
Test build #94461 has finished for PR 22044 at commit
|
|
retest this please |
|
Test build #94471 has finished for PR 22044 at commit
|
|
retest this please |
| } | ||
|
|
||
| @transient protected lazy val (hsPostFix, hsTypeName) = { | ||
| val ptName = CodeGenerator.primitiveTypeName (elementType) |
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: extra space after primitiveTypeName.
| } | ||
|
|
||
| private def setNotNullValue(isPrimitive: Boolean, | ||
| private def setNotNullValue( |
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.
We can inline this?
| case _ => false | ||
| } | ||
|
|
||
| @transient protected lazy val canUseSpecializedHashSet = elementType match { |
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.
Can we extract those common methods?
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.
We can do so. To minimize the changes due to remaining time for cutting, I would like to do this in another PR #21912.
| s"$distinctArray.set$primitiveValueTypeName($pos, $getValue1)" | ||
| } | ||
|
|
||
| private def setValueForFastEval( |
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.
Maybe we should rename this.
|
Test build #94487 has finished for PR 22044 at commit
|
| val openHashSet = classOf[OpenHashSet[_]].getName | ||
| val hs = ctx.freshName("hs") | ||
| val classTag = s"scala.reflect.ClassTag$$.MODULE$$.$hsTypeName()" | ||
| val getValue1 = CodeGenerator.getValue(array, elementType, i) |
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: val getValue?
|
Test build #94475 has finished for PR 22044 at commit
|
|
LGTM pending Jenkins. |
|
Test build #94488 has finished for PR 22044 at commit
|
|
Thanks! merging to master. |
What changes were proposed in this pull request?
This PR simplified code generation for
ArrayDistinct. #21966 enabled code generation only if the type can be specialized by the hash set. This PR follows this strategy.Optimization of null handling will be implemented in #21912.
How was this patch tested?
Existing UTs