avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hong Tang (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AVRO-23) Schema.toString() fails for a union of versioned records.
Date Mon, 27 Apr 2009 05:29:30 GMT

    [ 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: 
  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));
    List<Schema> union = new ArrayList<Schema>();
    Schema s3 = Schema.create(union);
    String ss = s3.toString();
    assertTrue(ss.length() > 0);

Error received:
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)

> 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

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message