title: load csv in pigLatin
body: <p>I have a csv file with following format</p>
  
  <pre><code>TRAABRX12903CC4816,1548880,2:19,4:7,...
  .
  .
  .
  </code></pre>
  
  <p>My problem is that I want to interpret as </p>
  
  <pre><code>{(key:chararray,key2:int,{(id:int,cnt:int)})}
  </code></pre>
  
  <p>So far my code is</p>
  
  <pre><code>data = LOAD 'mxm_dataset_test_3.txt' using PigStorage(',');
  data0 = foreach data generate $0 as key:chararray, {$2 ..} as bow;
  </code></pre>
  
  <p>For <code>data0</code> this the schema <code>data0: {key: chararray,bow: {(NULL)}}</code>
  When I try to explicit cast it to <code>(bag{tuple(chararray)})</code> with</p>
  
  <pre><code>data0 = foreach data generate $0 as key:chararray, {$2 ..} as bow;
  </code></pre>
  
  <p>this gives the error <code>Cannot cast bag with schema :bag{:tuple(:NULL)} to bag with schema :bag{:tuple(:chararray)}
  </code></p>