avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernd Fondermann (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AVRO-1320) Java: Trevni incorrectly reads specific enums.
Date Tue, 07 May 2013 19:05:16 GMT

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

Bernd Fondermann commented on AVRO-1320:
----------------------------------------

stack trace:

Exception in thread "main" java.lang.ClassCastException: java.lang.Integer cannot be cast
to generated.WPPageType
	at generated.WPPage.put(WPPage.java:50)
	at org.apache.avro.generic.GenericData.setField(GenericData.java:530)
	at org.apache.trevni.avro.AvroColumnReader.read(AvroColumnReader.java:221)
	at org.apache.trevni.avro.AvroColumnReader.next(AvroColumnReader.java:190)
	at trevni.TrevniFileDump.main(TrevniFileDump.java:38)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

schema:
{
    "namespace": "generated",
    "type": "record",
    "name": "WPPage",
    "fields": [
        {
            "name": "name",
            "type": "string"
        },
        {
            "name": "size",
            "type": "int"
        },
        {
            "name": "links",
            "type": {
                "type": "array",
                "items": "string"
            }
        },
        {
            "name": "type",
            "type": [
                {
                    "namespace": "generated",
                    "name": "WPPageType",
                    "type": "enum",
                    "symbols": ["article", "redirect", "disambiguation"]
                },
                "null"
            ]
        }
    ]
}

I'll try again without the union.
                
> Java: Trevni incorrectly reads specific enums.
> ----------------------------------------------
>
>                 Key: AVRO-1320
>                 URL: https://issues.apache.org/jira/browse/AVRO-1320
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Doug Cutting
>            Assignee: Doug Cutting
>             Fix For: 1.7.5
>
>         Attachments: AVRO-1320.patch
>
>
> Enums generated by the specific compiler are not read correctly when written to an Avro
data file.
> Reported by Bernd Fondermann on the developer mailing list.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message