Pig Latin is a high level language because it converts the commands or scripts to JAVA code and then runs them as a MapReduce job in the backend.
input_lines = LOAD ‘tmp/word.txt’ AS (line:chararry); words = FOREACH input_lines GENERATE FLATTEN(TOKENIZE(line)) AS word; filtered_words = FILTER words BY word MATCHES ‘\\w+';
word_groups = GROUP filtered_words BY word;
word_count = FOREACH word_groups GENERATE COUNT(filtered_words) AS count, group AS word;
ordered_word_count = ORDER word_count BY count DESC;
STORE ordered_word_count INTO ‘/tmp/results.txt’;
The above code is a PIG Latin code to perform word count, the same written in java would not be less than ~60 lines.
So in essence Pig reduces the number of lines that needs to be written to perform a job and also does not require you to have prior coding experience. However requires you to know SQL as most of the commands used are SQL like.
Hope this answers your question.
Regards, Karthik Gopal
Thanks for your answer but what is Low level language ?