Complete the code to create an HDFS directory using the Hadoop command.
hdfs dfs -mkdir [1]The -mkdir command creates a directory in HDFS. Here, /user/data is a valid directory path.
Complete the code to set the replication factor for a file in HDFS.
hdfs dfs -setrep [1] /user/data/file.txtSetting replication factor to 3 means each data block is stored on 3 different nodes for fault tolerance.
Fix the error in the command to copy a local file to HDFS.
hdfs dfs -put [1] /user/data/The -put command copies a local file to HDFS. The source must be a local file path.
Fill both blanks to create a dictionary comprehension that maps file names to their sizes if size is greater than 1000 bytes.
file_sizes = [1]: [2] for [1], [2] in files.items() if [2] > 1000}
The dictionary comprehension iterates over files.items() with filename and size as key and value. It filters sizes greater than 1000.
Fill all three blanks to create a dictionary comprehension that maps uppercase file names to their sizes if size is less than 5000 bytes.
filtered_files = [1]: [2] for [3], [2] in files.items() if [2] < 5000}
This comprehension converts file names to uppercase as keys, keeps sizes as values, and filters sizes less than 5000.