Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

[NSE-400] Fix the bug for negative decimal data #686

Merged
merged 3 commits into from
Jan 10, 2022

Conversation

haojinIntel
Copy link
Collaborator

@haojinIntel haojinIntel commented Jan 10, 2022

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

@github-actions
Copy link

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?

[NSE-${ISSUES_ID}] ${detailed message}

See also:

@haojinIntel haojinIntel changed the title Fix the bug for positive decimal data Fix the bug for negative decimal data Jan 10, 2022
@zhouyuan zhouyuan changed the title Fix the bug for negative decimal data [NSE-400] Fix the bug for negative decimal data Jan 10, 2022
@github-actions
Copy link

#400

@@ -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;
Copy link
Collaborator

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

@zhouyuan zhouyuan merged commit a26ab5a into oap-project:master Jan 10, 2022
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.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants