-
Notifications
You must be signed in to change notification settings - Fork 224
Added support to read and write Decimal128
to Avro
#837
Conversation
Codecov Report
@@ Coverage Diff @@
## main #837 +/- ##
==========================================
- Coverage 71.55% 71.43% -0.13%
==========================================
Files 327 327
Lines 17727 17782 +55
==========================================
+ Hits 12684 12702 +18
- Misses 5043 5080 +37
Continue to review full report at Codecov.
|
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 a lot, @potter420 . Would it be possible to add 2 tests, one in the read
where we show that we can read from avro-rs, and one in write
, to show that we can roundtrip decimals?
@jorgecarleitao For some reason I can't pass the let len = (x.leading_zeros() / 8) as usize;
util::zigzag_encode((16 - len) as i64, buf).unwrap();
buf.extend_from_slice(&x.to_be_bytes()[len..]); which is wrong. I fixed it by let len = ((x.leading_zeros() / 8) - ((x.leading_zeros() / 8) % 2)) as usize; Did some round trip with |
Decimal128
to avro round trip (Read/Write)Decimal128
to Avro
Flawless. Thanks a lot, @potter420 ! |
Hi, this is to partially address #733 .
Added read of
Decimal128
from bothfixed
andbytes
schema.Support writing to
bytes
schema to avro.