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

Use bytes instead of [n]bytes to represent decimal type #214

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

lyuboxa
Copy link
Contributor

@lyuboxa lyuboxa commented Oct 11, 2024

Description

Since each value may have larger size, as per spec https://avro.apache.org/docs/1.10.2/spec.pdf

{
  "type": "bytes",
  "logicalType": "decimal",
  "precision": 4,
  "scale": 2
}

A decimal logical type annotates Avro bytes or fixed types. The byte array must contain the two's-complement representation of the unscaled integer value in big-endian byte order. The scale is fixed, and is specified using an attribute.

Quick checks:

  • I have followed the Code Guidelines.
  • There is no other pull request for the same update/change.
  • I have written unit tests.
  • I have made sure that the PR is of reasonable size and can be easily reviewed.

@lyuboxa lyuboxa requested a review from a team as a code owner October 11, 2024 17:44
Copy link
Contributor

@hariso hariso left a comment

Choose a reason for hiding this comment

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

🚀

@lyuboxa lyuboxa merged commit e050bb9 into main Oct 11, 2024
3 checks passed
@lyuboxa lyuboxa deleted the lk/use-bytes-in-avro-numeric branch October 11, 2024 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants