Tips on Pig
Posted on Jan 09, 2014 in Computer Science
Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.
Tips
-
Pig uses
--
(at the beginning of lines) to comment out lines. It also support C-style comment, i.e., using/* ... */
-
Filter out records that you don't want before you do expensive transformations such as joining, crossing, etc.
-
Pig uses single quotes instead of double quotes for strings.
-
prefer filtering and then joining rather than joining and then filtering
-
Use dot/period to access fields when use aggregation functions, otherwise, use double colons (::) to access fileds/columns. but this is wierd
-
-p or -param
Common Mistakes
-
forget to assign relation to a name
-
use lower case of functions
-
use double quotes for strings