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

[HUDI-7443] Fix decimal conversion with legacy bytes type #10756

Merged

Conversation

stream2000
Copy link
Contributor

@stream2000 stream2000 commented Feb 26, 2024

Change Logs

Fix decimal conversion with legacy bytes type

Impact

Fix decimal conversion with legacy bytes type

Risk level (write none, low medium or high below)

low

Documentation Update

NONE

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

if (schema.getType() == Schema.Type.BYTES) {
return HoodieAvroUtils.DECIMAL_CONVERSION.toBytes(bd, schema, decimal);
} else {
return HoodieAvroUtils.DECIMAL_CONVERSION.toFixed(bd, schema, decimal);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without this fix, hudi will throw an exception here since bytes decimal can't call toFixed.

Copy link
Contributor

Choose a reason for hiding this comment

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

good catch ~

@stream2000
Copy link
Contributor Author

@hudi-bot run azure

@hudi-bot
Copy link

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@github-actions github-actions bot added the size:S PR with lines of changes in (10, 100] label Feb 26, 2024
@stream2000
Copy link
Contributor Author

image
Since CI is green now, could we move on this~ @danny0405

@danny0405 danny0405 merged commit 20e2348 into apache:master Feb 27, 2024
30 of 31 checks passed
@brandondahler
Copy link

brandondahler commented Jul 4, 2024

This may have also fixed https://issues.apache.org/jira/browse/HUDI-7388, will test and close out that issue if so.

Edit: That linked issue appears to still be present in 0.15.0, within which this PR's fix should have been included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:S PR with lines of changes in (10, 100]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants