title: Exception in type casting Chararry to double in PIG
body: <p>I have a sample input as tab separated key, value pair as follows</p>
  
  <pre><code>B_1001@2012-06-15   96.73429163933419@0.5511284347710459
  B_1001@2012-06-18   187.4348199976547@0.5544551559243536
  B_1002@2012-09-26   745.4912066349087@0.8398570478932768
  B_1002@2012-09-28   60.97117969729124@0.8500267379723409
  </code></pre>
  
  <p>and I am loading this file into pig and doing the following</p>
  
  <pre><code>a = load '/home/HadoopUser/Desktop/a.txt' as (key:chararray, value:chararray);
  
  describe a;
  a: {key: chararray,value: chararray}
  
  b = foreach a generate key, flatten(STRSPLIT(value,'@',2)) as (v1:double,v2:float);
  describe b;
  b: {key: chararray,v1: double,v2: float}
  
  c = group b by key;
   describe c;
  c: {group: chararray,b: {key: chararray,v1: double,v2: float}}
  </code></pre>
  
  <p>this works till here
  but
  when I use Arthematical calculations over b.v1 I am getting ClassCastException as java.lang.String can't be casted to java.lang.Double</p>
  
  <p>but describe gives no error</p>
  
  <pre><code>d = foreach c generate group,SUM(b.v1);
  describe d;
  d: {group: chararray,double}
  </code></pre>
  
  <p>when I dump d; it id giving the exception</p>
  
  <p>I even tried typecasting  'b' as well</p>
  
  <pre><code>b = foreach a generate key, (tuple (double,double))STRSPLIT(value,'@',2); 
  </code></pre>
  
  <p>now when I describe b;
  Its giving an error as
  Cannot cast tuple with schema tuple to tuple with schema tuple({double,double})</p>
  
  <p>Please help me to know why is it coming like this even describe shows correct schema.</p>