-
Notifications
You must be signed in to change notification settings - Fork 3k
Spark 3.2: Align formatting in bucket and truncate functions #5574
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 3.2: Align formatting in bucket and truncate functions #5574
Conversation
|
cc @aokolnychyi |
| if (input.isNullAt(NUM_BUCKETS_ORDINAL) || input.isNullAt(VALUE_ORDINAL)) { | ||
| return null; | ||
| } else { | ||
| return invoke(input.getInt(NUM_BUCKETS_ORDINAL), input.getInt(VALUE_ORDINAL)); |
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 a typo. Shall it still be input.getUTF8String()?
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.
Good catch. Updated!
| return null; | ||
| } | ||
|
|
||
| // TODO - We can probably hash the bytes directly given they're already UTF-8 input. |
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'd say it is a valid TODO item. We actually have a similar optimization internally.
I think we still have this TODO in 3.3.
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.
You're right. We left the optimization in truncate but didn't move forward with it for bucket. My mistake.
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.
Yeah, we should be able to pass the backing byte array. Let's do this in a follow-up for 3.3.
aokolnychyi
left a comment
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.
Thanks, @kbendick! I think there is one typo but looks good otherwise.
This PR aligns formatting in TruncateFunction and BucketFunction in Spark 3.2.
It backports #5573 to Spark 3.2