schema_registry_converter icon indicating copy to clipboard operation
schema_registry_converter copied to clipboard

working with avro decimal type

Open sfsf9797 opened this issue 5 months ago • 2 comments

image

Since this crate use apache avro [to_value] (https://github.com/gklijs/schema_registry_converter/blob/main/src/avro_common.rs#L144) function to convert serializable item to Value type, it might not work with avro schema with decimal field as the avro serializer might not convert it properly.

use apache_avro::Decimal;

#[derive(Serialize, Clone, Debug)]
pub struct item {
    // indexes
    pub total_successful_transaction_blocks: Decimal,

The total_successful_transaction_blocks will be serialized to "total_successful_transaction_blocks", Record([("value", Array([Int(1), Array([Int(7)])])), ("len", Long(1))]))

sfsf9797 avatar Sep 06 '24 08:09 sfsf9797