Hi Josh,

Sounds like you hit an edge case. From the Avro spec:

A type alias may be specified either as a fully namespace-qualified, or 
relative to the namespace of the name it is an alias for. For example, if a 
type named "a.b" has aliases of "c" and "x.y", then the fully qualified names 
of its aliases are "a.c" and "x.y".

Unless you've got a . in the alias name it looks like Avro is going to assume 
the relative case.


On Jun 27, 2014, at 5:02 PM, "Josh Buffum" 
<jbuf...@gmail.com<mailto:jbuf...@gmail.com>> wrote:

I've searched quite a bit and haven't found an answer to this question.

Is there a way for me to create a new record (with a namespace) using an old 
record name (with no namespace) as an alias?

{ "name" : "record1", type="record"... }

{ "namespace" : "some.namespace",
  "name" : "record2",
  "type": "record",
  "aliases: ["record1"]
...
}

The goal is to read .avro files written with the "record1" schema as objects of 
type some.namespace.record2.

According to the documentation, the alias of "record1" will automatically 
inherit the namespace of "record2" so the alias is really 
"some.namespace.record1". How do I make it just "record1" and still have the 
second record in a namespace ("some.namespace.record2")?

Thanks.

Josh

Reply via email to