Certified Associate Developer for Apache Spark Practice Test 15
Question 140
At Horizon Logistics, while optimizing an ETL application (fictional study case R280-C028-1), an engineer calls `repartition(200)` before a simple projection on already balanced source partitions. The change owner wants to avoid damaging unrelated tables, jobs or access. Which change boundary BEST limits the correction to the affected Spark workload? Select ONE best answer. This is unofficial original Spark educational practice, not a real certification item.
- Change output layout only for this dataset.
- Remove only the gratuitous repartition step.
- Separate shuffle configuration from cluster provisioning.
- Adjust output partition count only for the small result.
Explanation
Correct Answer
B:The relevant boundary is: Remove only the gratuitous repartition step. The correction remains: Remove the redundant repartition and retain source parallelism for the narrow projection.
Incorrect Answers
A:Change output layout only for this dataset. It is not the bounded choice for the stated condition: An engineer calls `repartition(200)` before a simple projection on already balanced source partitions. The permitted change must remain: Remove only the gratuitous repartition step.
C:Separate shuffle configuration from cluster provisioning. The action does not preserve the identified scope boundary: Remove only the gratuitous repartition step.
D:Adjust output partition count only for the small result. The action does not preserve the identified scope boundary: Remove only the gratuitous repartition step.
Question 141
At Aspen Public Services, after a Spark runtime upgrade (fictional study case R280-C029-1), a data lake expects `region=...` subdirectories, but output files are unpartitioned because writer settings omit the column. Which corrective Spark operation or design change BEST addresses the reported failure? Select ONE best answer. This is unofficial original Spark educational practice, not a real certification item.
- Use the writer's `.partitionBy('region')` with valid save mode and verify output layout.
- Tune shuffle partitions using data volume while configuring cluster executor resources separately.
- Coalesce or repartition appropriately before writing after checking downstream parallelism and data size.
- Use a suitable shuffle-enabled `repartition` when redistributing large data evenly is worth its cost.
Explanation
Correct Answer
A:The observed defect follows from: DataFrame partitioning and on-disk directory partitioning are different controls; `partitionBy` was not set for the write. The appropriate correction is: Use the writer's `.partitionBy('region')` with valid save mode and verify output layout. Confirm the result by verifying: Files are placed under region directories and all rows are preserved.
Incorrect Answers
B:Tune shuffle partitions using data volume while configuring cluster executor resources separately. The option targets a different stage or condition. The relevant failure is: DataFrame partitioning and on-disk directory partitioning are different controls; `partitionBy` was not set for the write. The needed repair is: Use the writer's `.partitionBy('region')` with valid save mode and verify output layout.
C:Coalesce or repartition appropriately before writing after checking downstream parallelism and data size. The recorded mechanism is: DataFrame partitioning and on-disk directory partitioning are different controls; `partitionBy` was not set for the write. The proposed action does not correct that mechanism; use: Use the writer's `.partitionBy('region')` with valid save mode and verify output layout.
D:Use a suitable shuffle-enabled `repartition` when redistributing large data evenly is worth its cost. The option targets a different stage or condition. The relevant failure is: DataFrame partitioning and on-disk directory partitioning are different controls; `partitionBy` was not set for the write. The needed repair is: Use the writer's `.partitionBy('region')` with valid save mode and verify output layout.
Question 142
At Juniper Foods, when validating a daily batch (fictional study case R280-C029-2), a data lake expects `region=...` subdirectories, but output files are unpartitioned because writer settings omit the column. The engineer wants to distinguish the mechanism before changing code. Which underlying Spark mechanism BEST explains the observed symptom? Select ONE best answer. This is unofficial original Spark educational practice, not a real certification item.
- The configuration controls default shuffle partition planning, not the number of executor processes.
- DataFrame partitioning and on-disk directory partitioning are different controls; `partitionBy` was not set for the write.
- Output file count follows task/partition structure rather than the actual dataset size.
- `coalesce` with a narrow dependency can consolidate work unevenly and reduce available parallelism.
Explanation
Correct Answer
B:Investigation should distinguish this specific mechanism: DataFrame partitioning and on-disk directory partitioning are different controls; `partitionBy` was not set for the write. The related symptom is: A data lake expects `region=..` subdirectories, but output files are unpartitioned because writer settings omit the column. The discriminating check is: Inspect resulting directory structure and schema after reading the output.
Incorrect Answers
A:The configuration controls default shuffle partition planning, not the number of executor processes. That explanation needs evidence of another fault. The specific mechanism here is: DataFrame partitioning and on-disk directory partitioning are different controls; `partitionBy` was not set for the write.
C:Output file count follows task/partition structure rather than the actual dataset size. The observed failure instead follows from: DataFrame partitioning and on-disk directory partitioning are different controls; `partitionBy` was not set for the write. The alternative does not explain the same dependency.
D:`coalesce` with a narrow dependency can consolidate work unevenly and reduce available parallelism. This is not the root cause established for the reported condition: A data lake expects `region=..` subdirectories, but output files are unpartitioned because writer settings omit the column. The cause is: DataFrame partitioning and on-disk directory partitioning are different controls; `partitionBy` was not set for the write.
Question 143
At Silverpeak Bioinformatics, when reviewing an incremental load (fictional study case R280-C029-1), a data lake expects `region=...` subdirectories, but output files are unpartitioned because writer settings omit the column. Competing explanations are being considered; choose the most discriminating check. Which evidence check BEST distinguishes this cause from a different Spark problem? Select ONE best answer. This is unofficial original Spark educational practice, not a real certification item.
- Compare effective config, shuffle task count and active executor list.
- Measure result bytes, partition count and per-file sizes before the write.
- Compare task input sizes and stage timing before and after partition adjustment.
- Inspect resulting directory structure and schema after reading the output.
Explanation
Correct Answer
D:The needed observation is: Inspect resulting directory structure and schema after reading the output. The suspected failure is: DataFrame partitioning and on-disk directory partitioning are different controls; `partitionBy` was not set for the write. The repair should only follow that check.
Incorrect Answers
A:Compare effective config, shuffle task count and active executor list. That does not establish whether the stated cause is present: DataFrame partitioning and on-disk directory partitioning are different controls; `partitionBy` was not set for the write. The diagnostic is: Inspect resulting directory structure and schema after reading the output.
B:Measure result bytes, partition count and per-file sizes before the write. The case requires a discriminating check before any change, not the offered alternative. Use: Inspect resulting directory structure and schema after reading the output.
C:Compare task input sizes and stage timing before and after partition adjustment. This is not the focused evidence-gathering step. Verify the suspected mechanism with: Inspect resulting directory structure and schema after reading the output.
Question 144
At Willowbank Software, before a production rollout (fictional study case R280-C029-2), a data lake expects `region=...` subdirectories, but output files are unpartitioned because writer settings omit the column. A proposed fix has been applied; its result still needs validation. Which measurable outcome BEST confirms the fix works without violating the data contract? Select ONE best answer. This is unofficial original Spark educational practice, not a real certification item.
- Shuffle task count matches configuration where applicable, without false executor-allocation assumptions.
- A manageable number of files is written with unchanged rows and schema.
- Files are placed under region directories and all rows are preserved.
- Tasks share the input more evenly and runtime meets the target.
Explanation
Correct Answer
C:Files are placed under region directories and all rows are preserved. This is an observable state after the correction: Use the writer's `.partitionBy('region')` with valid save mode and verify output layout. It confirms the original problem no longer occurs.
Incorrect Answers
A:Shuffle task count matches configuration where applicable, without false executor-allocation assumptions. Implementation or a check alone is not proof of success. The measurable end state is: Files are placed under region directories and all rows are preserved.
B:A manageable number of files is written with unchanged rows and schema. The alternative cannot demonstrate that the issue has been corrected: A data lake expects `region=..` subdirectories, but output files are unpartitioned because writer settings omit the column. The required result is: Files are placed under region directories and all rows are preserved.
D:Tasks share the input more evenly and runtime meets the target. This is not the observed recovery outcome. Acceptance requires: Files are placed under region directories and all rows are preserved.
Question 145
At Seabrook Education, while optimizing an ETL application (fictional study case R280-C029-1), a data lake expects `region=...` subdirectories, but output files are unpartitioned because writer settings omit the column. The change owner wants to avoid damaging unrelated tables, jobs or access. Which change boundary BEST limits the correction to the affected Spark workload? Select ONE best answer. This is unofficial original Spark educational practice, not a real certification item.
- Separate shuffle configuration from cluster provisioning.
- Adjust output partition count only for the small result.
- Repartition the bottleneck stage, not all upstream sources.
- Change output layout only for this dataset.
Explanation
Correct Answer
D:Keep the intervention within this boundary: Change output layout only for this dataset. The reported failure mechanism is: DataFrame partitioning and on-disk directory partitioning are different controls; `partitionBy` was not set for the write.
Incorrect Answers
A:Separate shuffle configuration from cluster provisioning. This does not enforce the required scope: Change output layout only for this dataset. The specific failure is: DataFrame partitioning and on-disk directory partitioning are different controls; `partitionBy` was not set for the write.
B:Adjust output partition count only for the small result. The action does not preserve the identified scope boundary: Change output layout only for this dataset.
C:Repartition the bottleneck stage, not all upstream sources. This does not enforce the required scope: Change output layout only for this dataset. The specific failure is: DataFrame partitioning and on-disk directory partitioning are different controls; `partitionBy` was not set for the write.
Question 146
At Bluewater Energy, after a Spark runtime upgrade (fictional study case R280-C030-1), a developer sets `spark.sql.shuffle.partitions=32` believing it will start 32 executors, but CPU allocation remains unchanged. Which corrective Spark operation or design change BEST addresses the reported failure? Select ONE best answer. This is unofficial original Spark educational practice, not a real certification item.
- Coalesce or repartition appropriately before writing after checking downstream parallelism and data size.
- Tune shuffle partitions using data volume while configuring cluster executor resources separately.
- Use a suitable shuffle-enabled `repartition` when redistributing large data evenly is worth its cost.
- Use key salting or skew-aware processing where semantic correctness permits, with recombination to preserve totals.
Explanation
Correct Answer
B:Tune shuffle partitions using data volume while configuring cluster executor resources separately. The technical or governance gap is: The configuration controls default shuffle partition planning, not the number of executor processes. Check the affected state using: Compare effective config, shuffle task count and active executor list.
Incorrect Answers
A:Coalesce or repartition appropriately before writing after checking downstream parallelism and data size. The recorded mechanism is: The configuration controls default shuffle partition planning, not the number of executor processes. The proposed action does not correct that mechanism; use: Tune shuffle partitions using data volume while configuring cluster executor resources separately.
C:Use a suitable shuffle-enabled `repartition` when redistributing large data evenly is worth its cost. That would not resolve the reported problem: A developer sets `spark.sql.shuffle.partitions=32` believing it will start 32 executors, but CPU allocation remains unchanged. The source-supported intervention is: Tune shuffle partitions using data volume while configuring cluster executor resources separately.
D:Use key salting or skew-aware processing where semantic correctness permits, with recombination to preserve totals. The recorded mechanism is: The configuration controls default shuffle partition planning, not the number of executor processes. The proposed action does not correct that mechanism; use: Tune shuffle partitions using data volume while configuring cluster executor resources separately.
Question 147
At Meridian Commerce, when validating a daily batch (fictional study case R280-C030-2), a developer sets `spark.sql.shuffle.partitions=32` believing it will start 32 executors, but CPU allocation remains unchanged. The engineer wants to distinguish the mechanism before changing code. Which underlying Spark mechanism BEST explains the observed symptom? Select ONE best answer. This is unofficial original Spark educational practice, not a real certification item.
- Output file count follows task/partition structure rather than the actual dataset size.
- `coalesce` with a narrow dependency can consolidate work unevenly and reduce available parallelism.
- Hash partitioning groups identical keys and a highly skewed key overwhelms a single partition.
- The configuration controls default shuffle partition planning, not the number of executor processes.
Explanation
Correct Answer
D:The failure is explained by: The configuration controls default shuffle partition planning, not the number of executor processes. A developer sets `spark.sql.shuffle.partitions=32` believing it will start 32 executors, but CPU allocation remains unchanged. Correcting it would require: Tune shuffle partitions using data volume while configuring cluster executor resources separately.
Incorrect Answers
A:Output file count follows task/partition structure rather than the actual dataset size. That explanation needs evidence of another fault. The specific mechanism here is: The configuration controls default shuffle partition planning, not the number of executor processes.
B:`coalesce` with a narrow dependency can consolidate work unevenly and reduce available parallelism. This is not the root cause established for the reported condition: A developer sets `spark.sql.shuffle.partitions=32` believing it will start 32 executors, but CPU allocation remains unchanged. The cause is: The configuration controls default shuffle partition planning, not the number of executor processes.
C:Hash partitioning groups identical keys and a highly skewed key overwhelms a single partition. That explanation needs evidence of another fault. The specific mechanism here is: The configuration controls default shuffle partition planning, not the number of executor processes.
Question 148
At Copperline Finance, when reviewing an incremental load (fictional study case R280-C030-1), a developer sets `spark.sql.shuffle.partitions=32` believing it will start 32 executors, but CPU allocation remains unchanged. Competing explanations are being considered; choose the most discriminating check. Which evidence check BEST distinguishes this cause from a different Spark problem? Select ONE best answer. This is unofficial original Spark educational practice, not a real certification item.
- Measure result bytes, partition count and per-file sizes before the write.
- Compare task input sizes and stage timing before and after partition adjustment.
- Profile key frequencies and per-partition bytes in the shuffle.
- Compare effective config, shuffle task count and active executor list.
Explanation
Correct Answer
D:A developer sets `spark.sql.shuffle.partitions=32` believing it will start 32 executors, but CPU allocation remains unchanged. The useful diagnostic is: Compare effective config, shuffle task count and active executor list. That can confirm or refute: The configuration controls default shuffle partition planning, not the number of executor processes.
Incorrect Answers
A:Measure result bytes, partition count and per-file sizes before the write. That does not establish whether the stated cause is present: The configuration controls default shuffle partition planning, not the number of executor processes. The diagnostic is: Compare effective config, shuffle task count and active executor list.
B:Compare task input sizes and stage timing before and after partition adjustment. This is not the focused evidence-gathering step. Verify the suspected mechanism with: Compare effective config, shuffle task count and active executor list.
C:Profile key frequencies and per-partition bytes in the shuffle. The case requires a discriminating check before any change, not the offered alternative. Use: Compare effective config, shuffle task count and active executor list.
Question 149
At Pinecrest Media, before a production rollout (fictional study case R280-C030-2), a developer sets `spark.sql.shuffle.partitions=32` believing it will start 32 executors, but CPU allocation remains unchanged. A proposed fix has been applied; its result still needs validation. Which measurable outcome BEST confirms the fix works without violating the data contract? Select ONE best answer. This is unofficial original Spark educational practice, not a real certification item.
- A manageable number of files is written with unchanged rows and schema.
- Tasks share the input more evenly and runtime meets the target.
- No partition dominates processing and per-country totals remain exact.
- Shuffle task count matches configuration where applicable, without false executor-allocation assumptions.
Explanation
Correct Answer
D:A passing check shows: Shuffle task count matches configuration where applicable, without false executor-allocation assumptions. This is evidence for the scoped change: Tune shuffle partitions using data volume while configuring cluster executor resources separately.
Incorrect Answers
A:A manageable number of files is written with unchanged rows and schema. This is not the observed recovery outcome. Acceptance requires: Shuffle task count matches configuration where applicable, without false executor-allocation assumptions.
B:Tasks share the input more evenly and runtime meets the target. Implementation or a check alone is not proof of success. The measurable end state is: Shuffle task count matches configuration where applicable, without false executor-allocation assumptions.
C:No partition dominates processing and per-country totals remain exact. Implementation or a check alone is not proof of success. The measurable end state is: Shuffle task count matches configuration where applicable, without false executor-allocation assumptions.
Question 150
At Ironlake Networks, while optimizing an ETL application (fictional study case R280-C030-1), a developer sets `spark.sql.shuffle.partitions=32` believing it will start 32 executors, but CPU allocation remains unchanged. The change owner wants to avoid damaging unrelated tables, jobs or access. Which change boundary BEST limits the correction to the affected Spark workload? Select ONE best answer. This is unofficial original Spark educational practice, not a real certification item.
- Adjust output partition count only for the small result.
- Separate shuffle configuration from cluster provisioning.
- Repartition the bottleneck stage, not all upstream sources.
- Apply skew mitigation to that keyed operation only.
Explanation
Correct Answer
B:The relevant boundary is: Separate shuffle configuration from cluster provisioning. The correction remains: Tune shuffle partitions using data volume while configuring cluster executor resources separately.
Incorrect Answers
A:Adjust output partition count only for the small result. It is not the bounded choice for the stated condition: A developer sets `spark.sql.shuffle.partitions=32` believing it will start 32 executors, but CPU allocation remains unchanged. The permitted change must remain: Separate shuffle configuration from cluster provisioning.
C:Repartition the bottleneck stage, not all upstream sources. The action does not preserve the identified scope boundary: Separate shuffle configuration from cluster provisioning.
D:Apply skew mitigation to that keyed operation only. The action does not preserve the identified scope boundary: Separate shuffle configuration from cluster provisioning.