avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Clueless <moreclueless...@gmail.com>
Subject Documentation/example on how to use DecimalConversion?
Date Thu, 17 Mar 2016 23:39:09 GMT
Hi

Could someone show me how to use Decimal's DecimalConversion?

I'm currently stuck with input bytes which isn't exactly fun and I can't
manage to figure out how to use the DecimalConversion stuff.

If it helps, I create my schema as such:
   Schema decPrecisionOne = LogicalTypes.decimal(1)
                .addToSchema(
                        SchemaBuilder.fixed("DecPrecisionOne")
                                .namespace("avro.trial")
                                .prop(LogicalType.LOGICAL_TYPE_PROP,
"decimal")
                                .size(10));
        Schema schema = SchemaBuilder.builder()
                .record("DecimalLogicalTypePojo").namespace("avro.trial")
                .fields()
                .name("someField").type(decPrecisionOne).noDefault()
                .endRecord();

Any help welcomed, I spent hours on the topic :ยง

thanks in advance
best

Mime
View raw message