Bird
0
0

Given the following PySpark code snippet:

medium📝 Predict Output Q4 of 15
Hadoop - Performance Tuning
Given the following PySpark code snippet:
df.write.format('orc').save('/data/output')

What will be the format of the saved file?
AAvro
BORC
CCSV
DParquet
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the write format method

    The code uses df.write.format('orc'), which specifies the ORC format for saving data.
  2. Step 2: Confirm the output format

    The save method writes the data in ORC format to the specified path.
  3. Final Answer:

    ORC -> Option B
  4. Quick Check:

    Write format 'orc' = ORC file [OK]
Quick Trick: format('orc') saves data in ORC format [OK]
Common Mistakes:
  • Assuming default Parquet format
  • Confusing ORC with Avro
  • Ignoring format() method

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Hadoop Quizzes