0
0
Hadoopdata~10 mins

Pig vs Hive comparison in Hadoop - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to load data in Pig Latin.

Hadoop
data = LOAD 'input.txt' USING [1] AS (name:chararray, age:int);
Drag options to blanks, or click blank then click option'
AHiveStorage
BPigStorage(',')
CTextLoader
DJsonLoader
Attempts:
3 left
💡 Hint
Common Mistakes
Using HiveStorage in Pig script.
Using JsonLoader for plain text files.
2fill in blank
medium

Complete the Hive query to select all records from a table.

Hadoop
SELECT * FROM [1];
Drag options to blanks, or click blank then click option'
Adatabase
Bview
Ccolumn
Dtable_name
Attempts:
3 left
💡 Hint
Common Mistakes
Using database name instead of table name.
Using column name in FROM clause.
3fill in blank
hard

Fix the error in the Pig script to filter records where age is greater than 30.

Hadoop
filtered = FILTER data BY age [1] 30;
Drag options to blanks, or click blank then click option'
A=
B==
C>
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using == instead of >.
Using = which is assignment, not comparison.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension in Python that filters words longer than 3 characters.

Hadoop
lengths = {word: [1] for word in words if len(word) [2] 3}
Drag options to blanks, or click blank then click option'
Alen(word)
B>
C<
Dword
Attempts:
3 left
💡 Hint
Common Mistakes
Using < instead of > in the condition.
Using word instead of len(word) for the value.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase keys to values greater than 0.

Hadoop
result = { [1]: [2] for k, v in data.items() if v [3] 0 }
Drag options to blanks, or click blank then click option'
Ak.upper()
Bv
C>
Dk.lower()
Attempts:
3 left
💡 Hint
Common Mistakes
Using k.lower() instead of k.upper().
Using < instead of > in the condition.