You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Daniel Dai (JIRA)" <ji...@apache.org> on 2015/04/24 23:02:41 UTC

[jira] [Updated] (PIG-4506) binstorage fails to write biginteger

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

Daniel Dai updated PIG-4506:
----------------------------
    Fix Version/s: 0.15.0

> binstorage fails to write biginteger
> ------------------------------------
>
>                 Key: PIG-4506
>                 URL: https://issues.apache.org/jira/browse/PIG-4506
>             Project: Pig
>          Issue Type: Bug
>          Components: data, impl
>            Reporter: Savvas Savvides
>             Fix For: 0.15.0
>
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> When trying to store a biginteger using binstorage the following error is issued (The error might manifest elsewhere too):
> java.lang.RuntimeException: Unexpected data type -1 found in stream
> This is caused by a bug in the writeDatum method of the DataReaderWriter.java class. When writeDatum is called with a BigInteger as a argument, the BigInteger is converted to a byte[] and the writeDatum method is recursively called on the byte[]. writeDatum cannon handle byte[] objects but instead expects DataByteArray objects.
> Suggested fix - wrap byte[] to DataByteArray:
> change this line:
> _writeDatum(out, ((BigInteger)val).toByteArray());_
> to this:
> _writeDatum(out, new DataByteArray(((BigInteger)val).toByteArray()));_



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