incubator-gora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henry Saputra (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GORA-32) Map type with long values generates non-compilable Java class
Date Thu, 23 Jun 2011 13:14:47 GMT

    [ https://issues.apache.org/jira/browse/GORA-32?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053837#comment-13053837
] 

Henry Saputra commented on GORA-32:
-----------------------------------

LGTM.

Patch committed with rev1138866. Thanks al lot.

> Map type with long values generates non-compilable Java class
> -------------------------------------------------------------
>
>                 Key: GORA-32
>                 URL: https://issues.apache.org/jira/browse/GORA-32
>             Project: Gora
>          Issue Type: Bug
>          Components: schema
>    Affects Versions: 0.1-incubating
>            Reporter: Yves Langisch
>         Attachments: GORA-32.patch, unboxing.patch
>
>
> I have the following Avro JSON schema:
> {
>     "type": "record",
>     "name": "Request",
>     "namespace": "ch.test.generated",
>     "fields" : [
>         {
>             "name": "data",
>             "type": {
>                 "type": "map",
>                 "values": "long"
>             }
>         }
>     ]
> }
> Compiling the schema I get a Java class that does not compile. The problem is that primitive
types are not allowed in generic maps:
> ...
>   public Map<Utf8, long> getData() {
>     return (Map<Utf8, long>) get(0);
>   }
> ...
> The issue seems to be that in the {{GoraCompiler}} class the unboxed types are used.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message