Skip to content

Conversation

@kecookier
Copy link

What changes were proposed in this pull request?

Set dstBatch's decimal and precision when DecimalConvertColumnReader::next.
Fix ORC-1881.

Why are the changes needed?

During decimal-to-decimal conversion in SchemaEvolution, the target decimal's scale and precision are incorrectly initialized to zero, producing a corrupted ColumnVectorBatch.

How was this patch tested?

Unit test.

Was this patch authored or co-authored using generative AI tooling?

No.

@github-actions github-actions bot added the CPP label Apr 21, 2025
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.

Thank you for making a PR, @kecookier .

According to the Affected Version of JIRA issues, this only affects ORC 2.x?

@kecookier
Copy link
Author

Thank you for making a PR, @kecookier .

According to the Affected Version of JIRA issues, this only affects ORC 2.x?

@dongjoon-hyun Yes, the schema evolution for decimal types is introduced in ORC 2.x

Copy link
Contributor

@ffacs ffacs left a comment

Choose a reason for hiding this comment

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

LGTM

@ffacs ffacs changed the title ORC-1881: Populate dstBatch's scale and precision in DecimalConvertColumnReader ORC-1881: [C++] Populate dstBatch's scale and precision in DecimalConvertColumnReader Apr 22, 2025
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.5 milestone Apr 22, 2025
dongjoon-hyun pushed a commit that referenced this pull request Apr 22, 2025
…vertColumnReader

### What changes were proposed in this pull request?

Set dstBatch's decimal and precision when `DecimalConvertColumnReader::next`.
Fix ORC-1881.

### Why are the changes needed?

During decimal-to-decimal conversion in `SchemaEvolution`, the target decimal's scale and precision are incorrectly initialized to zero, producing a corrupted `ColumnVectorBatch`.

### How was this patch tested?

Unit test.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #2194 from kecookier/fix-decimal-2-decimal.

Authored-by: zhaokuo03 <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit 44990bd)
Signed-off-by: Dongjoon Hyun <[email protected]>
@dongjoon-hyun dongjoon-hyun modified the milestones: 2.0.5, 2.1.2 Apr 22, 2025
@dongjoon-hyun
Copy link
Member

Merged to main (Apache ORC 2.2) and branch-2.1 (Apache ORC 2.1).

Welcome to the Apache ORC community, @kecookier . I added you to the Apache ORC contributor group and assigned ORC-1881 to you.

Since branch-2.0 is currently broken due to C++ linter error, I didn't backport this. Please make a backporting PR to branch-2.0, @kecookier .

kecookier pushed a commit to kecookier/orc that referenced this pull request Apr 22, 2025
…vertColumnReader

### What changes were proposed in this pull request?

Set dstBatch's decimal and precision when `DecimalConvertColumnReader::next`.
Fix ORC-1881.

### Why are the changes needed?

During decimal-to-decimal conversion in `SchemaEvolution`, the target decimal's scale and precision are incorrectly initialized to zero, producing a corrupted `ColumnVectorBatch`.

### How was this patch tested?

Unit test.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes apache#2194 from kecookier/fix-decimal-2-decimal.

Authored-by: zhaokuo03 <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
kecookier pushed a commit to kecookier/orc that referenced this pull request Apr 22, 2025
…vertColumnReader

Set dstBatch's decimal and precision when `DecimalConvertColumnReader::next`.
Fix ORC-1881.

During decimal-to-decimal conversion in `SchemaEvolution`, the target decimal's scale and precision are incorrectly initialized to zero, producing a corrupted `ColumnVectorBatch`.

Unit test.

No.

Closes apache#2194 from kecookier/fix-decimal-2-decimal.

Authored-by: zhaokuo03 <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
kecookier pushed a commit to kecookier/orc that referenced this pull request Apr 25, 2025
…vertColumnReader

Set dstBatch's decimal and precision when `DecimalConvertColumnReader::next`.
Fix ORC-1881.

During decimal-to-decimal conversion in `SchemaEvolution`, the target decimal's scale and precision are incorrectly initialized to zero, producing a corrupted `ColumnVectorBatch`.

Unit test.

No.

Closes apache#2194 from kecookier/fix-decimal-2-decimal.

Authored-by: zhaokuo03 <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
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.

4 participants