Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Pig Wiki" for change 
notification.

The following page has been changed by OlgaN:
http://wiki.apache.org/pig/PigUserCookbook

------------------------------------------------------------------------------
  ''' Use Types '''
  This feature is only available in the new code currently accessible from 
types branch: http://svn.apache.org/viewvc/hadoop/pig/branches/types/.
  
- If types are not specified in the load statement, Pig assumes the type of 
=double= for numeric computations. A lot of the time, your data would be much 
smaller, maybe, integer or long. Specifying the real type will help with speed 
of arithmetic computation. In some of our queries with see 2x speedup. It has 
an additional advantage of early error detection.
+ If types are not specified in the load statement, Pig assumes the type of 
=double= for numeric computations. A lot of the time, your data would be much 
smaller, maybe, integer or long. Specifying the real type will help with speed 
of arithmetic computation. It has an additional advantage of early error 
detection.
  
+ {{{
+ --Query 1
+ A = load 'myfile' as (t, u, v);
+ B = foreach A generate t + u;
+ 
+ --Query 2
+ A = load 'myfile' as (t: int, u: int, v);
+ B = foreach A generate t + u;
+ }}}
+ 
+ The second query will run more efficiently than the first. In some of our 
queries with see 2x speedup.
  
  ''' Project Early and Often '''
  

Reply via email to