[
https://issues.apache.org/jira/browse/AVRO-23?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12702993#action_12702993
]
Hong Tang commented on AVRO-23:
-------------------------------
test case:
{code}
public void testVersionedUnion() throws Exception {
Schema s1 = Schema.create("R", null, false);
Schema s2 = Schema.create("R", null, false);
Map<String, Schema> f1 = new LinkedHashMap<String, Schema>();
f1.put("a", Schema.create(Type.BOOLEAN));
Map<String, Schema> f2 = new LinkedHashMap<String, Schema>();
f2.put("a", Schema.create(Type.INT));
s1.setFields(f1);
s2.setFields(f2);
List<Schema> union = new ArrayList<Schema>();
union.add(s1);
union.add(s2);
Schema s3 = Schema.create(union);
String ss = s3.toString();
assertTrue(ss.length() > 0);
}
{code}
Error received:
{code}
Can't redefine: R
org.apache.avro.SchemaParseException: Can't redefine: R
at org.apache.avro.Schema$Names.put(Schema.java:439)
at org.apache.avro.Schema$Names.put(Schema.java:1)
at org.apache.avro.Schema$RecordSchema.toString(Schema.java:234)
at org.apache.avro.Schema$UnionSchema.toString(Schema.java:333)
at org.apache.avro.Schema.toString(Schema.java:167)
{code}
> Schema.toString() fails for a union of versioned records.
> ---------------------------------------------------------
>
> Key: AVRO-23
> URL: https://issues.apache.org/jira/browse/AVRO-23
> Project: Avro
> Issue Type: Improvement
> Components: java
> Reporter: Hong Tang
>
> Schema.toString() fails to create a string representation for a union that
> contains versioned records.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.