avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Cutting (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AVRO-699) Emprty name for a type in .avro file creates java class with compile-time errors.
Date Fri, 19 Nov 2010 22:22:13 GMT

    [ https://issues.apache.org/jira/browse/AVRO-699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12934019#action_12934019
] 

Doug Cutting commented on AVRO-699:
-----------------------------------

Avro does not permit empty names:

http://avro.apache.org/docs/current/spec.html#Names

As of AVRO-671, Java now throws parse errors for such schemas.  This will be included in Avro
1.5.0, hopefully by the end of the year.

I propose closing this as a duplicate of AVRO-671.  Is that acceptable?

> Emprty name for a type in .avro file creates java class with compile-time errors.
> ---------------------------------------------------------------------------------
>
>                 Key: AVRO-699
>                 URL: https://issues.apache.org/jira/browse/AVRO-699
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.4.1
>         Environment: Windows 2003 Server
>            Reporter: prabhakhar kaliyamurthy
>
> Emprty name for a type in .avro file creates java class with compile-time errors.
> Try to generate  java object for the following avro defintion.
> {
> "namespace" : "com.ebay.test.benchmark.avro",
> "protocol": "AvroBenchmarkProtocol",
> "doc": "BenchmarkingAvro",
> "types" : [
>  {
>  	"type" : "record",
>  	"name" : "AvroBenchmarkObject",
>  	"fields" : [ 	
>  	    {"name" : "", "type": "string"}
>  	 ]
>  }   
>    ]
> }
> is creating the following  java class with compile time error.
> package com.ebay.test.benchmark.avro;
> @SuppressWarnings("all")
> public class AvroBenchmarkObject extends org.apache.avro.specific.SpecificRecordBase
implements org.apache.avro.specific.SpecificRecord {
>   public static final org.apache.avro.Schema SCHEMA$ = org.apache.avro.Schema.parse("{\"type\":\"record\",\"name\":\"AvroBenchmarkObject\",\"namespace\":\"com.ebay.test.benchmark.avro\",\"fields\":[{\"name\":\"\",\"type\":\"int\"}]}");
>   public int ;
>   public org.apache.avro.Schema getSchema() { return SCHEMA$; }
>   // Used by DatumWriter.  Applications should not call. 
>   public java.lang.Object get(int field$) {
>     switch (field$) {
>     case 0: return ;
>     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
>     }
>   }
>   // Used by DatumReader.  Applications should not call. 
>   @SuppressWarnings(value="unchecked")
>   public void put(int field$, java.lang.Object value$) {
>     switch (field$) {
>     case 0:  = (java.lang.Integer)value$; break;
>     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
>     }
>   }
> }

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


Mime
View raw message