[
https://issues.apache.org/jira/browse/CRUNCH-99?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gabriel Reid updated CRUNCH-99:
-------------------------------
Attachment: CRUNCH-99c.patch
The patch looks to work fine, but I made a couple of small updates to it.
There is already a BYTES_IN MapFn used in Avros to do the same thing (i.e.
handle either byte[] or ByteBuffer), so I made use of that -- that way we can
get rid of this kind of stuff easier if/when we stop supporting Avro 1.5.4.
What do you think?
Also, the unit test didn't actually fail (but did complain a lot in the logs)
even if the functionality didn't work, so I updated it a bit so that it will
actively fail if it doesn't work.
By the way, do you know where/when the change was made in Avro to use
ByteBuffer instead of byte array? I did a bit of quick checking but didn't find
it right away. I was thinking that we might even be able to isolate this a bit
in the AvroCapabilities class so it could be easier to clean up in the future
when we stop worrying about supporting Avro 1.5.4.
> Avros.writables throws ClassCastException
> -----------------------------------------
>
> Key: CRUNCH-99
> URL: https://issues.apache.org/jira/browse/CRUNCH-99
> Project: Crunch
> Issue Type: Bug
> Components: Core
> Affects Versions: 0.3.0
> Reporter: Josh Wills
> Assignee: Josh Wills
> Attachments: CRUNCH-99b.patch, CRUNCH-99c.patch, CRUNCH-99.patch
>
>
> I hit this issue running 0.3.0 w/Avro 1.5.4-- the BytesToWritableMapFn is
> expecting a ByteBuffer as input, but it will be a byte[] instead. Adding the
> same instanceof check that we have elsewhere for this situation is the
> workaround I came up with.
--
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