This repository has been archived by the owner on Sep 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
[NSE-400] Fix the bug for negative decimal data #686
Merged
Merged
Conversation
This file contains 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
Thanks for opening a pull request! Could you open an issue for this pull request on Github Issues? https://github.com/oap-project/native-sql-engine/issues Then could you also rename commit message and pull request title in the following format?
See also: |
haojinIntel
changed the title
Fix the bug for positive decimal data
Fix the bug for negative decimal data
Jan 10, 2022
zhouyuan
changed the title
Fix the bug for negative decimal data
[NSE-400] Fix the bug for negative decimal data
Jan 10, 2022
zhouyuan
reviewed
Jan 10, 2022
@@ -393,6 +393,11 @@ arrow::Status CreateArrayData(std::shared_ptr<arrow::Schema> schema, int64_t num | |||
for (int k = length - 1; k >= 0; k--) { | |||
bytesValue2[length - 1 - k] = bytesValue[k]; | |||
} | |||
if (int8_t(bytesValue[0]) < 0) { | |||
for (int k = length; k < 16; k++) { | |||
bytesValue2[k] = 255; |
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.
note: for negative decimal, all unused bits are set to 1
…atch pruning (whole-stage-codegen on)'
zhouyuan
pushed a commit
to zhouyuan/native-sql-engine
that referenced
this pull request
Jan 10, 2022
* Fix the bug for positive decimal data * Fix format * Fix the unit test for 'SPARK-22348: table cache should do partition batch pruning (whole-stage-codegen on)'
zhouyuan
added a commit
that referenced
this pull request
Jan 10, 2022
* [NSE-684] BufferedOutputStream causes massive futex system calls (#685) * [NSE-400] Fix the bug for negative decimal data (#686) * Fix the bug for positive decimal data * Fix format * Fix the unit test for 'SPARK-22348: table cache should do partition batch pruning (whole-stage-codegen on)' * [NSE-687]remove exclude log4j when running ut (#688) * remove exclude log4j when running ut * Modify hadoop 2.7 ut to the right hadoop dependency version 2.7.4 Co-authored-by: Hongze Zhang <hongze.zhang@intel.com> Co-authored-by: haojinIntel <hao.jin@intel.com> Co-authored-by: Wei-Ting Chen <weiting.chen@intel.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What changes were proposed in this pull request?
Fix the bug for negative decimal data
in arrow all the unused bits should be set to 255.
How was this patch tested?
pass jenkins