avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zadravec János <jzadra...@gmail.com>
Subject registering custom logical type with java
Date Thu, 24 Aug 2017 09:31:30 GMT
Hi Guys,

I am trying to register custom logical type handler in Java, but don't know
how to map the java class to the logical type in the schema.

My class

public class ShortString extends LogicalType{


  public ShortString() {
    super("short-string");
  }

  @Override
  public void validate(Schema schema) {
    throw new IllegalArgumentException("not implemented");

  }
}


My schema:


"type": "record",
"namespace": "com.xy.serialization",
"name": "SerializableLineItem",
"fields":
[
    {
        "name": "lineItemId",
        "type": "string",
        "logicalType": "short-string",
        "namespace": "com.amazon.awsbilladjustments.avro"
    }

]

}, {logicalTypes: {'short-string': ????ShortString.class????}}


Anyobdy has any idea ?



Thanks,


Janos

Mime
View raw message