Optimize the reading of numerical frame arrays in MSQ #15175
Merged
LakshSingla merged 2 commits intoapache:masterfrom Oct 17, 2023
Merged
Optimize the reading of numerical frame arrays in MSQ #15175LakshSingla merged 2 commits intoapache:masterfrom
LakshSingla merged 2 commits intoapache:masterfrom
Conversation
cryptoe
approved these changes
Oct 17, 2023
| { | ||
| updatePosition(); | ||
|
|
||
| long rowPointerPosition = rowPointer.position(); |
Contributor
There was a problem hiding this comment.
I think we should use rowWithPositionCached here
| updatePosition(); | ||
|
|
||
| long rowPointerPosition = rowPointer.position(); | ||
| if (rowPointerPosition == rowWithLengthCached) { |
Contributor
There was a problem hiding this comment.
Suggested change
| if (rowPointerPosition == rowWithLengthCached) { | |
| if (rowPointerPosition == rowWithCachedLength) { |
| private void updatePosition() | ||
| { | ||
| long rowPointerPosition = rowPointer.position(); | ||
| if (rowPointerPosition == rowWithPositionCached) { |
Contributor
There was a problem hiding this comment.
Suggested change
| if (rowPointerPosition == rowWithPositionCached) { | |
| if (rowPointerPosition == rowWithCachedPosition) { |
Contributor
Author
|
Thanks for the review @cryptoe! Updated the PR. |
LakshSingla
added a commit
to LakshSingla/druid
that referenced
this pull request
Oct 17, 2023
cryptoe
pushed a commit
that referenced
this pull request
Oct 18, 2023
CaseyPan
pushed a commit
to CaseyPan/druid
that referenced
this pull request
Nov 17, 2023
gianm
added a commit
to gianm/druid
that referenced
this pull request
Mar 5, 2024
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.
gianm
added a commit
that referenced
this pull request
Mar 5, 2024
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Currently, MSQ adds the numbers from the array field and adds it to a
Listand 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: