You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Murtaza Kanchwala (JIRA)" <ji...@apache.org> on 2015/02/26 15:41:05 UTC

[jira] [Commented] (AVRO-1487) avro-tools totrevni throwing 'org.apache.avro.util.Utf8 cannot be cast to java.lang.String'

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

Murtaza Kanchwala commented on AVRO-1487:
-----------------------------------------

I am also facing the Same Issue where in my case the Java Object consists of a field of type String instead of CharSequence and then It throws an Excpetion "ClassCastException: org.apache.avro.util.Utf8 cannot be cast to java.lang.String" And If I keep CharSequence as it is then it throws Serialization error which something belongs to this issue : AVRO-200 . Not sure if this also fixed.

Any help would be appreciated.
Thanks

> avro-tools totrevni throwing 'org.apache.avro.util.Utf8 cannot be cast to java.lang.String'
> -------------------------------------------------------------------------------------------
>
>                 Key: AVRO-1487
>                 URL: https://issues.apache.org/jira/browse/AVRO-1487
>             Project: Avro
>          Issue Type: Bug
>          Components: trevni
>    Affects Versions: 1.7.6
>         Environment: Linux 2.6.32-431.5.1.el6.x86_64, java version "1.7.0_51"
>            Reporter: Mina Naguib
>            Priority: Minor
>
> I'm not sure if this is expected to fail or this is a bug - I was excited to try trevni but got:
> $ java -jar avro-tools-1.7.6.jar totrevni part-r-00000.avro part-r-00000.trevni
> Mar 25, 2014 11:01:11 AM org.apache.hadoop.util.NativeCodeLoader <clinit>
> WARNING: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
> Exception in thread "main" java.lang.ClassCastException: org.apache.avro.util.Utf8 cannot be cast to java.lang.String
> 	at org.apache.trevni.OutputBuffer.writeValue(OutputBuffer.java:58)
> 	at org.apache.trevni.ColumnOutputBuffer.writeValue(ColumnOutputBuffer.java:64)
> 	at org.apache.trevni.ColumnFileWriter.writeValue(ColumnFileWriter.java:113)
> 	at org.apache.trevni.avro.AvroColumnWriter.write(AvroColumnWriter.java:104)
> 	at org.apache.trevni.avro.AvroColumnWriter.write(AvroColumnWriter.java:142)
> 	at org.apache.trevni.avro.AvroColumnWriter.write(AvroColumnWriter.java:111)
> 	at org.apache.trevni.avro.AvroColumnWriter.write(AvroColumnWriter.java:88)
> 	at org.apache.avro.tool.ToTrevniTool.run(ToTrevniTool.java:76)
> 	at org.apache.avro.tool.Main.run(Main.java:84)
> 	at org.apache.avro.tool.Main.main(Main.java:73)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)