Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

ffacs
Copy link
Contributor

@ffacs ffacs commented Sep 27, 2023

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

@github-actions github-actions bot added the CPP label Sep 27, 2023
Copy link
Member

@wgtmac wgtmac left a 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++/include/orc/Int128.hh Show resolved Hide resolved
@@ -1201,4 +1201,20 @@ namespace orc {
<< pair.second.toString();
}

TEST(Int128, testConverToDouble) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TEST(Int128, testConverToDouble) {
TEST(Int128, testConvertToDouble) {

c++/src/Int128.cc Show resolved Hide resolved
const FileTypeBatch& srcBatch) {
using FileType = decltype(srcBatch.values[idx]);
Int128 result = scaleDownInt128ByPowerOfTen(srcBatch.values[idx], scale);
int64_t longValue = result.toLong();
Copy link
Member

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.

Comment on lines 515 to 517
double doubleValue = 0;
Int128 i128 = srcBatch.values[idx];
doubleValue = i128.toDouble();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
double doubleValue = 0;
Int128 i128 = srcBatch.values[idx];
doubleValue = i128.toDouble();
double doubleValue = srcBatch.values[idx].toDouble();

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM.

@dongjoon-hyun dongjoon-hyun added this to the 2.0.0 milestone Oct 11, 2023
@wgtmac wgtmac closed this in 5ce80ae Oct 12, 2023
cxzl25 pushed a commit to cxzl25/orc that referenced this pull request Jan 11, 2024
### 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>
@ffacs ffacs deleted the ORC-1387 branch January 12, 2024 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants