Roger created AVRO-2864:
---------------------------
Summary: IDL does not fully support arbitrary logical types
Key: AVRO-2864
URL: https://issues.apache.org/jira/browse/AVRO-2864
Project: Apache Avro
Issue Type: Bug
Reporter: Roger
There seems to be no way to specify a logical type other than the ones built in
to IDL (decimal, date, time-millis, timestamp-millis) when the type is not used
at the top level in a field.
For example, it is not possible to specify an array of long with logical type
timestamp-micros.
If you do:
protocol _ {
record R {
@logicalType("timestamp-micros")
array<long> times;
}
}
the "logicalType" attribute will be associated with the array type and not the
element type.
The resulting AVSC (as converted by the idl2schemata tool) looks like this:
{
"type" : "record",
"name" : "R",
"fields" : [ {
"name" : "times",
"type" : {
"type" : "array",
"items" : "long",
"logicalType" : "timestamp-micros"
}
} ]
}
I would expect the logical type to be associated with the element type, but
even if the tool is changed to do that, it's still not complete, because
there's no way to associate a logical type with a member of a union.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)