avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Koert Kuipers <ko...@tresata.com>
Subject re-use or copy a Field
Date Fri, 03 Feb 2012 21:57:06 GMT
I often find myself manipulating record schemas or creating new ones from
the fields of existing ones in Java.

Now at first i just tried to re-use a field of an existing record schema in
a new record schema, but no luck: i ran into the "Field already used"
runtime exception. Apparently a field is aware of its position and does not
like to be re-used because of that. For the same reason i assume
Field.clone() or something like that will be of no use either.

I could create a copy myself using the Field constructor, however that way
i lose the aliases and props. In avro 1.5.4 there is no way to get to these

Any suggestions? Thanks

View raw message