avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thiruvalluvan M. G. (JIRA)" <j...@apache.org>
Subject [jira] Updated: (AVRO-706) Java: Type promotion not succeeding for long -> float
Date Thu, 02 Dec 2010 18:09:12 GMT

     [ https://issues.apache.org/jira/browse/AVRO-706?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Thiruvalluvan M. G. updated AVRO-706:

    Attachment: AVRO-706.patch

There were two bugs:

1. int and long were not getting promoted to float
2. double was getting "promoted" to long, which is not in the spec.

The attached patch fixes both the bugs. There were already tests for (1) but were commented
(I can't remember why). I un-commented them. There was a test verify the wrong behavior (2).
I removed it after ensuring that it indeed fails after the patch.

> Java: Type promotion not succeeding for long -> float
> -----------------------------------------------------
>                 Key: AVRO-706
>                 URL: https://issues.apache.org/jira/browse/AVRO-706
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.4.1
>            Reporter: Scott Carey
>            Assignee: Thiruvalluvan M. G.
>             Fix For: 1.5.0
>         Attachments: AVRO-706.patch
> A bug reported on the dev email list.  I have not confirmed it:
> {quote}
> Hi,
> Avro spec says that writer schema's long can be promoted to reader
> schema's float or double.  In my test, I'm getting ErrorAction from
> ResolvingGrammarGenerator.generate() when writer schema is long and
> reader schema expects float.  Looking at the source code, when reader
> and writer type are not the same, the switch(readerType) only handles
> Long, Double and Union, not Float. This is the reason I'm getting "Found
> Long, expecting Float" error.
> Best regards,
> Xiaolu
> {quote}

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

View raw message