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

Mridul Muralidharan commented on PIG-1745:
------------------------------------------


As of now, as we have more loaders - sherpa, fish, hive, etc - which require 
similar functionality which is already duplicated by BinStorage, hbase, etc : 
all of them will end up exposing details of this nature directly to the user : 
that too in ways which are validated differently by each (not to mention 
duplication of code).

load and store func's are getting overloaded with functionalitywhich is not 
directly (but cosmetically) related to their operation : like in this case, 
where we tie casting to the loader - but configure it "externally" with the 
loader acting as a delegate for it.
Instead of each loader reinventing and exposing similar (or different) idioms, 
would be better to abstract this away into pig : either as a grammar construct 
or as something else with reasonable smart default provided by the loader 
(getDefaultLoadCaster instead of getLoadCaster ?).

> Disable converting bytes loading from BinStorage
> ------------------------------------------------
>
>                 Key: PIG-1745
>                 URL: https://issues.apache.org/jira/browse/PIG-1745
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.8.0
>            Reporter: Daniel Dai
>            Assignee: Daniel Dai
>             Fix For: 0.9.0
>
>         Attachments: PIG-1745-1.patch, PIG-1745-2.patch, PIG-1745-3.patch
>
>
> If we load bytes from BinStorage, we don't actually know how we get these 
> bytes originally, and we will not have a way to cast those bytes. Ideally we 
> shall encode caster into BinStorage data file, but we are not there yet. 
> Currrently bytesToXXX methods for BinStorage is wrong and it results 
> unexpected errors. Eg.
> {code}
> a = load '1.txt' as (a0, a1, a2);
> store a into '1.bin' as BinStorage();
> a = load '1.bin' using BinStorage as (a0, a1, a2);
> b = foreach a generate (long)a0;
> dump b;
> {code}
> The code will run but produce wrong data. It's less confusing if we throw an 
> exception in this case.
> Release Notes:
> Pig will throw exception in the case we want to convert bytes loading from 
> BinStorage

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

Reply via email to