Complete the code to list files in a Hadoop directory.
hadoop fs -ls [1]The command hadoop fs -ls /data/input lists files in the input directory.
Complete the code to copy a file from Hadoop to local filesystem.
hadoop fs -[1] /data/input/file.txt ./put which uploads files instead.copyFromLocal which copies local to Hadoop.The get command copies files from Hadoop to local.
Fix the error in the command to remove a Hadoop directory recursively.
hadoop fs -rm -[1] /data/old_data-rf which is a Unix command, not Hadoop fs.-f without recursion.The -r flag is used to remove directories recursively in Hadoop.
Fill both blanks to create a cloud-native command to copy data from Hadoop to AWS S3.
hadoop distcp [1] [2]
s3n:// which is deprecated.The distcp command copies data from Hadoop HDFS to AWS S3 using the hdfs:// and s3a:// paths.
Fill all three blanks to write a Spark command to read data from cloud storage and show the first 5 rows.
spark.read.format([1]).load([2]).[3]
show without parentheses or row count.This Spark code reads parquet files from S3 and shows the first 5 rows using show(5).
