
Answer-first summary for fast verification
Answer: Append mode is selected by default, adding only new records to the target table.
In Spark streaming queries, the output mode can be specified using `.outputMode()`. There are three types of output modes supported: Complete Mode (replaces the entire table), Append Mode (adds only new records), and Update Mode (updates only changed rows). If the output mode is not specified, the query does not fail; instead, Append mode is auto-selected as the default. This ensures that only new records are added to the target table without altering existing data.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
When a streaming query is initiated without specifying an output mode, and the target table already contains records, what happens?
A
The query fails because the output mode is mandatory.
B
Complete mode is automatically selected, replacing the entire table with the current micro-batch of data.
C
Update mode, the default output mode, is selected, updating only the rows changed since the last micro-batch.
D
Append mode is selected by default, adding only new records to the target table.
E
The output mode is determined by the type of data being loaded.
No comments yet.