Bird
0
0

What is wrong with this code to read an ORC file in PySpark?

medium📝 Debug Q7 of 15
Hadoop - Performance Tuning
What is wrong with this code to read an ORC file in PySpark?
spark.read.orc()
AMissing file path argument in orc() method
Borc() method does not exist in PySpark
CORC files cannot be read by PySpark
DMust use format('orc') instead of orc()
Step-by-Step Solution
Solution:
  1. Step 1: Check orc() method usage

    spark.read.orc() requires a file path argument to specify the ORC file location.
  2. Step 2: Confirm method existence

    orc() method exists in PySpark, so orc() method does not exist in PySpark is incorrect. PySpark supports ORC (A wrong), and format('orc') is an alternative but not mandatory (D wrong).
  3. Final Answer:

    Missing file path argument in orc() method -> Option A
  4. Quick Check:

    orc() needs file path argument [OK]
Quick Trick: Always provide path when reading ORC files [OK]
Common Mistakes:
  • Calling orc() without path
  • Thinking orc() method is missing
  • Believing PySpark can't read ORC

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Hadoop Quizzes