0
0
Hadoopdata~10 mins

Why HDFS handles petabyte-scale storage in Hadoop - Test Your Understanding

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

Complete the code to create an HDFS directory using the Hadoop command.

Hadoop
hdfs dfs -mkdir [1]
Drag options to blanks, or click blank then click option'
A/tmp/file
B/user/data
C-ls
Ddatafile.txt
Attempts:
3 left
💡 Hint
Common Mistakes
Using a filename instead of a directory path
Using a command option instead of a path
2fill in blank
medium

Complete the code to set the replication factor for a file in HDFS.

Hadoop
hdfs dfs -setrep [1] /user/data/file.txt
Drag options to blanks, or click blank then click option'
A0
B-rm
Cfile.txt
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Using zero or negative numbers
Using command options instead of numbers
3fill in blank
hard

Fix the error in the command to copy a local file to HDFS.

Hadoop
hdfs dfs -put [1] /user/data/
Drag options to blanks, or click blank then click option'
A/local/path/file.txt
B-copyFromLocal
Chdfs://file.txt
D/user/data/file.txt
Attempts:
3 left
💡 Hint
Common Mistakes
Using HDFS path as source
Using command options as source
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps file names to their sizes if size is greater than 1000 bytes.

Hadoop
file_sizes = [1]: [2] for [1], [2] in files.items() if [2] > 1000}
Drag options to blanks, or click blank then click option'
Afilename
Bsize
Cfiles
Ditems
Attempts:
3 left
💡 Hint
Common Mistakes
Using the dictionary name as variable
Mixing keys and values
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase file names to their sizes if size is less than 5000 bytes.

Hadoop
filtered_files = [1]: [2] for [3], [2] in files.items() if [2] < 5000}
Drag options to blanks, or click blank then click option'
Afilename.upper()
Bsize
Cfilename
Dfiles
Attempts:
3 left
💡 Hint
Common Mistakes
Using dictionary name as key
Not converting to uppercase
Mixing variable names