This question concerns Avro version 1.8.1.
We have the following field in our AVRO schema:
"name" : "sale_price",
"type" : ["bytes", "null"],
"logicalType": "decimal",
"precision": 18,
"scale": 17,
As you can see, the logicalType of the field has been defined as decimal
.
But when we use the avro-maven-plugin
, it does not generate the correct data type within the generated Java source files.
Instead it generates, java.nio.ByteBuffer
.
How would you have the correct data type generated within the Java files?
This is our plugin configuration:
<plugin>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
<version>1.8.1</version>
<configuration>
<stringType>String</stringType>
<enableDecimalLogicalType>true</enableDecimalLogicalType>
</configuration>
</plugin>
enableDecimalLogicalType
was introduced in Avro 1.8.2 (not yet released). – Warnock