avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jay Hacker <jayqhac...@gmail.com>
Subject Primitive type aliases
Date Fri, 12 Apr 2013 19:15:22 GMT
I'd like to be able to alias primitive types, for example to indicate that
a field of type "date" is really a string that I should treat specially.
The spec says "Named types and fields may have aliases," which suggests it
ought to work ("string" is a named type...).

I don't really know how to express an alias for a primitive, but things
like this:

{
    "type": "record",
    "name": "alias-test",
    "fields": [
        {"name": "start", "type": {"type": "string", "aliases": ["date"]}},
        {"name": "end",   "type": "date"}
    ]
}

don't work (at least not in the Python 1.7.4 implementation: 'Type property
"date" not a valid Avro schema').  How can I alias a primitive type, and if
not, why not?

Thanks.

Mime
View raw message