Hello All,

I have an avro schema that includes the following as a field:

{
  "name" : "currency",
  "type" : ["null","bytes"],
  "logicalType": "decimal",
  "precision": 9,
  "scale": 4
},

When I run the avro-tools on it  to create a java file representing the schema 
it produces a property that looks like public java.nio.ByteBuffer currency;

However, in other parts of the program I'm using Scala with values in 
BigDecimal types.

How can I convert a BigDecimal value to the expected ByteBuffer?

Is there anything special I need to do to ensure it is compatible with avro and 
other tools like Impala?

Also is this the correct form to using currency values?

Cheers,

David Newberger

Reply via email to