Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Avro >> mail # user >> Confused about default values


+
Markus Weimer 2010-08-02, 23:28
+
Doug Cutting 2010-08-02, 23:40
+
Jeff Hammerbacher 2010-08-02, 23:43
Copy link to this message
-
Re: Confused about default values
Also, if this turns out to be the issue, please file a JIRA to ensure we
provide a clear error message to the user when we parse the schema.

On Mon, Aug 2, 2010 at 4:43 PM, Jeff Hammerbacher <[EMAIL PROTECTED]>wrote:

> Hey,
>
> I think the issue is that you put "0.0" in quotes. Try just 0.0.
>
> Later,
> Jeff
>
>
> On Mon, Aug 2, 2010 at 4:40 PM, Doug Cutting <[EMAIL PROTECTED]> wrote:
>
>> That sounds like something that should work.  Can you submit a bug report,
>> ideally with a complete test case?  Thanks!
>>
>> Doug
>>
>>
>> On 08/02/2010 04:28 PM, Markus Weimer wrote:
>>
>>> Hi,
>>>
>>> I added the following line to a schema, recreated the static java classes
>>> for it and compiled my code:
>>>
>>> {"name": "bias", "type":"double", "default":"0.0"}
>>>
>>> When I now try to read a file written before the change, I get an error:
>>>
>>> Exception in thread "main" java.io.EOFException
>>>         at
>>> org.apache.avro.io.BinaryDecoder.readDouble(BinaryDecoder.java:154)
>>>         at
>>>
>>> org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:82)
>>>         at
>>>
>>> org.apache.avro.generic.GenericDatumReader.readArray(GenericDatumReader.java
>>> :273)
>>>         at
>>>
>>> org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:74)
>>>         at
>>>
>>> org.apache.avro.generic.GenericDatumReader.readRecord(GenericDatumReader.jav
>>> a:154)
>>>         at
>>>
>>> org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:72)
>>>         at
>>>
>>> org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:61)
>>>
>>>
>>> I assumed that it would just return 0.0 for the fields not present in the
>>> file. Is this a bug on my end?
>>>
>>> Thanks,
>>>
>>> Markus
>>>
>>>
>
+
Scott Carey 2010-08-03, 01:01
+
Markus Weimer 2010-08-04, 17:31
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB