-
Notifications
You must be signed in to change notification settings - Fork 483
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
ORC-1387: [C++] Support schema evolution from decimal to numeric/decimal #1629
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.
Thanks! Mostly LGTM. I've left some comments.
c++/test/TestInt128.cc
Outdated
@@ -1201,4 +1201,20 @@ namespace orc { | |||
<< pair.second.toString(); | |||
} | |||
|
|||
TEST(Int128, testConverToDouble) { |
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.
TEST(Int128, testConverToDouble) { | |
TEST(Int128, testConvertToDouble) { |
c++/src/ConvertColumnReader.cc
Outdated
const FileTypeBatch& srcBatch) { | ||
using FileType = decltype(srcBatch.values[idx]); | ||
Int128 result = scaleDownInt128ByPowerOfTen(srcBatch.values[idx], scale); | ||
int64_t longValue = result.toLong(); |
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.
This would be better to move to below line 508.
c++/src/ConvertColumnReader.cc
Outdated
double doubleValue = 0; | ||
Int128 i128 = srcBatch.values[idx]; | ||
doubleValue = i128.toDouble(); |
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.
double doubleValue = 0; | |
Int128 i128 = srcBatch.values[idx]; | |
doubleValue = i128.toDouble(); | |
double doubleValue = srcBatch.values[idx].toDouble(); |
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.
+1, LGTM.
### What changes were proposed in this pull request? Support schema evolution from decimal to {boolean, byte, short, int, long, float, double, decimal} ### Why are the changes needed? to support schema evolution ### How was this patch tested? UT passed Closes apache#1629 from ffacs/ORC-1387. Authored-by: ffacs <ffacs520@gmail.com> Signed-off-by: Gang Wu <ustcwg@gmail.com>
What changes were proposed in this pull request?
Support schema evolution from decimal to {boolean, byte, short, int, long, float, double, decimal}
Why are the changes needed?
to support schema evolution
How was this patch tested?
UT passed