You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "prabhakhar kaliyamurthy (JIRA)" <ji...@apache.org> on 2010/11/19 22:49:18 UTC
[jira] Created: (AVRO-699) Emprty name for a type in .avro file
creates java class with compile-time errors.
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.
[jira] Commented: (AVRO-699) Emprty name for a type in .avro file
creates java class with compile-time errors.
Posted by "prabhakhar kaliyamurthy (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AVRO-699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12933997#action_12933997 ]
prabhakhar kaliyamurthy commented on AVRO-699:
----------------------------------------------
I am generating the classes with the following command.
java org.apache.avro.specific.SpecificCompiler BenchmarkObject.avro .
> 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.
[jira] Commented: (AVRO-699) Emprty name for a type in .avro file
creates java class with compile-time errors.
Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Resolved: (AVRO-699) Emprty name for a type in .avro file
creates java class with compile-time errors.
Posted by "prabhakhar kaliyamurthy (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AVRO-699?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
prabhakhar kaliyamurthy resolved AVRO-699.
------------------------------------------
Resolution: Duplicate
Fix Version/s: 1.5.0
Thank you for your quick response and the fix. I will close this as a duplicate of AVRO-671.
I didnt notice the other jira item. My apologies for taking your time.
-- Thanks,
Prabhakhar K
> 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
> Fix For: 1.5.0
>
>
> 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.