You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all thank you for the amazing work you have put in, in this library!
I would like some help with the following problem:
As seen below, I am working on a requirement about exposing some data using the Avro serialization format over Rest:
...
final GenericRecord value = stateStoreQuery.get(key);
final byte[] valueBytes = new JsonAvroConverter().convertToJson(value);
final String response = new String(valueBytes);
return ResponseEntity.ok(response);
Almost all data types are getting converted correctly but decimals. I am assuming this is related to the fact that my Avro POJO uses BigDecimals to represent decimal numbers. I know that this is a logical type in Avro rather than a primitive.
For example the number 0.6060 initialized as new BigDecimal("0.6060") comes back as �¬.
What I am trying to detect unsuccessfully so far is whether the cause of the problem is:
The default instance of ObjectMapper used in JsonGenericRecordReader and it doesn't support the conversion from BigDecimals to Strings.
The fact that the library does not support Logical types which I doubt as it uses the GenericDatumWriter under the hood.
I explicitly need to load any logical types given that BigDecimals are encoded as Avro BYTES.
Any help will be much appreciated!
Thanks in advance!
The text was updated successfully, but these errors were encountered:
First of all thank you for the amazing work you have put in, in this library!
I would like some help with the following problem:
As seen below, I am working on a requirement about exposing some data using the Avro serialization format over Rest:
...
final GenericRecord value = stateStoreQuery.get(key);
final byte[] valueBytes = new JsonAvroConverter().convertToJson(value);
final String response = new String(valueBytes);
return ResponseEntity.ok(response);
Almost all data types are getting converted correctly but decimals. I am assuming this is related to the fact that my Avro POJO uses BigDecimals to represent decimal numbers. I know that this is a logical type in Avro rather than a primitive.
For example the number 0.6060 initialized as new BigDecimal("0.6060") comes back as �¬.
What I am trying to detect unsuccessfully so far is whether the cause of the problem is:
The default instance of ObjectMapper used in JsonGenericRecordReader and it doesn't support the conversion from BigDecimals to Strings.
The fact that the library does not support Logical types which I doubt as it uses the GenericDatumWriter under the hood.
I explicitly need to load any logical types given that BigDecimals are encoded as Avro BYTES.
Any help will be much appreciated!
Thanks in advance!
Hello Georgios, I also need BigDecimal logical type support. Were you able to progress on this?
Hi all,
First of all thank you for the amazing work you have put in, in this library!
I would like some help with the following problem:
As seen below, I am working on a requirement about exposing some data using the Avro serialization format over Rest:
Almost all data types are getting converted correctly but decimals. I am assuming this is related to the fact that my Avro POJO uses
BigDecimal
s to represent decimal numbers. I know that this is a logical type in Avro rather than a primitive.For example the number
0.6060
initialized asnew BigDecimal("0.6060")
comes back as�¬
.What I am trying to detect unsuccessfully so far is whether the cause of the problem is:
ObjectMapper
used inJsonGenericRecordReader
and it doesn't support the conversion from BigDecimals to Strings.GenericDatumWriter
under the hood.BYTES
.Any help will be much appreciated!
Thanks in advance!
The text was updated successfully, but these errors were encountered: