-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Optimize the reading of numerical frame arrays in MSQ #15175
Optimize the reading of numerical frame arrays in MSQ #15175
Conversation
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.
Minor comments. LGTM!!
{ | ||
updatePosition(); | ||
|
||
long rowPointerPosition = rowPointer.position(); |
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 we should use rowWithPositionCached
here
updatePosition(); | ||
|
||
long rowPointerPosition = rowPointer.position(); | ||
if (rowPointerPosition == rowWithLengthCached) { |
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.
if (rowPointerPosition == rowWithLengthCached) { | |
if (rowPointerPosition == rowWithCachedLength) { |
private void updatePosition() | ||
{ | ||
long rowPointerPosition = rowPointer.position(); | ||
if (rowPointerPosition == rowWithPositionCached) { |
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.
if (rowPointerPosition == rowWithPositionCached) { | |
if (rowPointerPosition == rowWithCachedPosition) { |
Thanks for the review @cryptoe! Updated the PR. |
Since apache#15175, the javadoc for ReadableFieldPointer is somewhat out of date. It says that the pointer only points to the beginning of the field, but this is no longer true. This patch updates the javadoc to be more accurate.
Since #15175, the javadoc for ReadableFieldPointer is somewhat out of date. It says that the pointer only points to the beginning of the field, but this is no longer true. This patch updates the javadoc to be more accurate.
Description
Currently, MSQ adds the numbers from the array field and adds it to a
List
and converts this list toObject[]
while returning it from the column value selector.This patch optimizes this sequence by directly creating the
Object[]
. To do so, it requires the number of elements present in the array, which it gets by introducingReadableFieldPointer#length()
method.No additional tests are required since the current reading and writing tests would handle the new codepaths
This PR has: