-
Notifications
You must be signed in to change notification settings - Fork 169
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
fix: dictionary decimal vector optimization #705
fix: dictionary decimal vector optimization #705
Conversation
common/src/main/java/org/apache/comet/vector/CometDictionary.java
Outdated
Show resolved
Hide resolved
common/src/main/java/org/apache/comet/vector/CometDictionary.java
Outdated
Show resolved
Hide resolved
@andygrove @parthchandra I moved the logic to the reader side, in that way, this PR will help for native exec as well |
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'm not entirely sure how this helps on the exec side, could you provide a short explanation?
Otherwise lgtm
@@ -83,6 +82,18 @@ public byte[] decodeToBinary(int index) { | |||
case FIXEDSIZEBINARY: | |||
return values.getBinary(index); | |||
case DECIMAL: | |||
if (binaries == null) { |
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 wonder if this need to be made thread safe?
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 don't think this gets read in multiple threads, but even if it would be, it is overwrite, so should be fine.
Thanks @parthchandra |
Merged Thanks @parthchandra @andygrove |
## Which issue does this PR close? Part of apache#679 and apache#670 Related apache#490 ## Rationale for this change For dictionary decimal vectors, it was unpacking even for Int and Long decimals that used more memory than necessary. ## What changes are included in this PR? Unpack only for Decimal 128 ## How are these changes tested? Existing test (cherry picked from commit c1b7c7d)
Which issue does this PR close?
Part of #679 and #670
Related #490
Rationale for this change
For dictionary decimal vectors, it was unpacking even for Int and Long decimals that used more memory than necessary.
What changes are included in this PR?
Unpack only for Decimal 128
How are these changes tested?
Existing test