Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to list files in a Hadoop directory.
Hadoop
hadoop fs -ls [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a directory path that does not exist.
Forgetting the leading slash in the path.
✗ Incorrect
The command hadoop fs -ls /data/input lists files in the input directory.
2fill in blank
mediumComplete the code to copy a file from Hadoop to local filesystem.
Hadoop
hadoop fs -[1] /data/input/file.txt ./ Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
put which uploads files instead.Using
copyFromLocal which copies local to Hadoop.✗ Incorrect
The get command copies files from Hadoop to local.
3fill in blank
hardFix the error in the command to remove a Hadoop directory recursively.
Hadoop
hadoop fs -rm -[1] /data/old_data Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
-rf which is a Unix command, not Hadoop fs.Using
-f without recursion.✗ Incorrect
The -r flag is used to remove directories recursively in Hadoop.
4fill in blank
hardFill both blanks to create a cloud-native command to copy data from Hadoop to AWS S3.
Hadoop
hadoop distcp [1] [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
s3n:// which is deprecated.Mixing up source and destination paths.
✗ Incorrect
The distcp command copies data from Hadoop HDFS to AWS S3 using the hdfs:// and s3a:// paths.
5fill in blank
hardFill all three blanks to write a Spark command to read data from cloud storage and show the first 5 rows.
Hadoop
spark.read.format([1]).load([2]).[3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
show without parentheses or row count.Using incorrect format strings like "csv" instead of "parquet".
✗ Incorrect
This Spark code reads parquet files from S3 and shows the first 5 rows using show(5).