Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

What is the difference betweent High Level Language and Low Level language with example? As i know Pig Latin is HLL.

Highlighted

What is the difference betweent High Level Language and Low Level language with example? As i know Pig Latin is HLL.

Rising Star
 
2 REPLIES 2
Highlighted

Re: What is the difference betweent High Level Language and Low Level language with example? As i know Pig Latin is HLL.

Contributor

Hi Mahesh,

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.

Example:

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

Highlighted

Re: What is the difference betweent High Level Language and Low Level language with example? As i know Pig Latin is HLL.

Rising Star

Thanks for your answer but what is Low level language ?

Don't have an account?
Coming from Hortonworks? Activate your account here