
Answer-first summary for fast verification
Answer: `try: except:`
The correct answer is `try: except:`. This is the proper way to handle exceptions in Python, including PySpark, to ensure that failures are caught and handled gracefully without stopping the execution of the program abruptly.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
To handle failures gracefully in PySpark, which of the following correctly completes the statement?\n\nSpark.read.table("table_name").select("column").write.mode("append").SaveAsTable("new_table_name")\n\nprint(f"query failed")
A
try: failure:
B
try: catch:
C
try: except:
D
try: fail:
E
try: error:
No comments yet.