Certified Associate Developer for Apache Spark Practice Test 14
Question 130
At Cedarline Telecommunications, while optimizing an ETL application (fictional study case R280-C026-1), a large dataset is reduced from hundreds of partitions to two without a shuffle, leaving one expensive serial task. 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.
- Apply skew mitigation to that keyed operation only.
- Remove only the gratuitous repartition step.
- Change output layout only for this dataset.
- Repartition the bottleneck stage, not all upstream sources.
Explanation
Correct Answer
D:The relevant boundary is: Repartition the bottleneck stage, not all upstream sources. The correction remains: Use a suitable shuffle-enabled `repartition` when redistributing large data evenly is worth its cost.
Incorrect Answers
A:Apply skew mitigation to that keyed operation only. The action does not preserve the identified scope boundary: Repartition the bottleneck stage, not all upstream sources.
B:Remove only the gratuitous repartition step. This does not enforce the required scope: Repartition the bottleneck stage, not all upstream sources. The specific failure is: `coalesce` with a narrow dependency can consolidate work unevenly and reduce available parallelism.
C:Change output layout only for this dataset. This does not enforce the required scope: Repartition the bottleneck stage, not all upstream sources. The specific failure is: `coalesce` with a narrow dependency can consolidate work unevenly and reduce available parallelism.
Question 131
At Cobalt Analytics, after a Spark runtime upgrade (fictional study case R280-C027-1), most records have `country='US'`, so repartitioning by country sends far more data to one task. 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 key salting or skew-aware processing where semantic correctness permits, with recombination to preserve totals.
- Remove the redundant repartition and retain source parallelism for the narrow projection.
- 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.
Explanation
Correct Answer
A:Use key salting or skew-aware processing where semantic correctness permits, with recombination to preserve totals. The technical or governance gap is: Hash partitioning groups identical keys and a highly skewed key overwhelms a single partition. Check the affected state using: Profile key frequencies and per-partition bytes in the shuffle.
Incorrect Answers
B:Remove the redundant repartition and retain source parallelism for the narrow projection. The recorded mechanism is: Hash partitioning groups identical keys and a highly skewed key overwhelms a single partition. The proposed action does not correct that mechanism; use: Use key salting or skew-aware processing where semantic correctness permits, with recombination to preserve totals.
C:Use the writer's `.partitionBy('region')` with valid save mode and verify output layout. The option targets a different stage or condition. The relevant failure is: Hash partitioning groups identical keys and a highly skewed key overwhelms a single partition. The needed repair is: Use key salting or skew-aware processing where semantic correctness permits, with recombination to preserve totals.
D:Tune shuffle partitions using data volume while configuring cluster executor resources separately. That would not resolve the reported problem: Most records have `country='US'`, so repartitioning by country sends far more data to one task. The source-supported intervention is: Use key salting or skew-aware processing where semantic correctness permits, with recombination to preserve totals.
Question 132
At Summit Supply, when validating a daily batch (fictional study case R280-C027-2), most records have `country='US'`, so repartitioning by country sends far more data to one task. 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.
- Repartitioning introduces an extra shuffle without a downstream distribution requirement.
- Hash partitioning groups identical keys and a highly skewed key overwhelms a single partition.
- DataFrame partitioning and on-disk directory partitioning are different controls; `partitionBy` was not set for the write.
- The configuration controls default shuffle partition planning, not the number of executor processes.
Explanation
Correct Answer
B:Investigation should distinguish this specific mechanism: Hash partitioning groups identical keys and a highly skewed key overwhelms a single partition. The related symptom is: Most records have `country='US'`, so repartitioning by country sends far more data to one task. The discriminating check is: Profile key frequencies and per-partition bytes in the shuffle.
Incorrect Answers
A:Repartitioning introduces an extra shuffle without a downstream distribution requirement. The observed failure instead follows from: Hash partitioning groups identical keys and a highly skewed key overwhelms a single partition. The alternative does not explain the same dependency.
C:DataFrame partitioning and on-disk directory partitioning are different controls; `partitionBy` was not set for the write. That explanation needs evidence of another fault. The specific mechanism here is: Hash partitioning groups identical keys and a highly skewed key overwhelms a single partition.
D:The configuration controls default shuffle partition planning, not the number of executor processes. This is not the root cause established for the reported condition: Most records have `country='US'`, so repartitioning by country sends far more data to one task. The cause is: Hash partitioning groups identical keys and a highly skewed key overwhelms a single partition.
Question 133
At Granite Insurance, when reviewing an incremental load (fictional study case R280-C027-1), most records have `country='US'`, so repartitioning by country sends far more data to one task. 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 physical plans for Exchange nodes and output parity.
- Profile key frequencies and per-partition bytes in the shuffle.
- Inspect resulting directory structure and schema after reading the output.
- Compare effective config, shuffle task count and active executor list.
Explanation
Correct Answer
B:Profile key frequencies and per-partition bytes in the shuffle. This gathers evidence about the stated mechanism: Hash partitioning groups identical keys and a highly skewed key overwhelms a single partition. The existing symptom is: Most records have `country='US'`, so repartitioning by country sends far more data to one task.
Incorrect Answers
A:Compare physical plans for Exchange nodes and output parity. That does not establish whether the stated cause is present: Hash partitioning groups identical keys and a highly skewed key overwhelms a single partition. The diagnostic is: Profile key frequencies and per-partition bytes in the shuffle.
C:Inspect resulting directory structure and schema after reading the output. This is not the focused evidence-gathering step. Verify the suspected mechanism with: Profile key frequencies and per-partition bytes in the shuffle.
D:Compare effective config, shuffle task count and active executor list. This is not the focused evidence-gathering step. Verify the suspected mechanism with: Profile key frequencies and per-partition bytes in the shuffle.
Question 134
At Elmwood Manufacturing, before a production rollout (fictional study case R280-C027-2), most records have `country='US'`, so repartitioning by country sends far more data to one task. 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.
- The unnecessary shuffle disappears with identical projected rows.
- No partition dominates processing and per-country totals remain exact.
- Files are placed under region directories and all rows are preserved.
- Shuffle task count matches configuration where applicable, without false executor-allocation assumptions.
Explanation
Correct Answer
B:The verification result must be: No partition dominates processing and per-country totals remain exact. It is stronger evidence than merely performing: Profile key frequencies and per-partition bytes in the shuffle.
Incorrect Answers
A:The unnecessary shuffle disappears with identical projected rows. The alternative cannot demonstrate that the issue has been corrected: Most records have `country='US'`, so repartitioning by country sends far more data to one task. The required result is: No partition dominates processing and per-country totals remain exact.
C:Files are placed under region directories and all rows are preserved. Implementation or a check alone is not proof of success. The measurable end state is: No partition dominates processing and per-country totals remain exact.
D:Shuffle task count matches configuration where applicable, without false executor-allocation assumptions. This is not the observed recovery outcome. Acceptance requires: No partition dominates processing and per-country totals remain exact.
Question 135
At Lakeside Devices, while optimizing an ETL application (fictional study case R280-C027-1), most records have `country='US'`, so repartitioning by country sends far more data to one task. 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.
- Remove only the gratuitous repartition step.
- Change output layout only for this dataset.
- Separate shuffle configuration from cluster provisioning.
- Apply skew mitigation to that keyed operation only.
Explanation
Correct Answer
D:Keep scope tied to the actual issue: Most records have `country='US'`, so repartitioning by country sends far more data to one task. The bounded intervention is: Apply skew mitigation to that keyed operation only. Confirm: No partition dominates processing and per-country totals remain exact.
Incorrect Answers
A:Remove only the gratuitous repartition step. It is not the bounded choice for the stated condition: Most records have `country='US'`, so repartitioning by country sends far more data to one task. The permitted change must remain: Apply skew mitigation to that keyed operation only.
B:Change output layout only for this dataset. It is not the bounded choice for the stated condition: Most records have `country='US'`, so repartitioning by country sends far more data to one task. The permitted change must remain: Apply skew mitigation to that keyed operation only.
C:Separate shuffle configuration from cluster provisioning. It is not the bounded choice for the stated condition: Most records have `country='US'`, so repartitioning by country sends far more data to one task. The permitted change must remain: Apply skew mitigation to that keyed operation only.
Question 136
At Bayfront Markets, after a Spark runtime upgrade (fictional study case R280-C028-1), an engineer calls `repartition(200)` before a simple projection on already balanced source partitions. 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.
- Remove the redundant repartition and retain source parallelism for the narrow projection.
- 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.
Explanation
Correct Answer
B:An engineer calls `repartition(200)` before a simple projection on already balanced source partitions. The underlying cause is: Repartitioning introduces an extra shuffle without a downstream distribution requirement. The corrective step is: Remove the redundant repartition and retain source parallelism for the narrow projection. Validate the outcome: The unnecessary shuffle disappears with identical projected rows.
Incorrect Answers
A:Use the writer's `.partitionBy('region')` with valid save mode and verify output layout. The recorded mechanism is: Repartitioning introduces an extra shuffle without a downstream distribution requirement. The proposed action does not correct that mechanism; use: Remove the redundant repartition and retain source parallelism for the narrow projection.
C:Tune shuffle partitions using data volume while configuring cluster executor resources separately. The option targets a different stage or condition. The relevant failure is: Repartitioning introduces an extra shuffle without a downstream distribution requirement. The needed repair is: Remove the redundant repartition and retain source parallelism for the narrow projection.
D:Coalesce or repartition appropriately before writing after checking downstream parallelism and data size. The recorded mechanism is: Repartitioning introduces an extra shuffle without a downstream distribution requirement. The proposed action does not correct that mechanism; use: Remove the redundant repartition and retain source parallelism for the narrow projection.
Question 137
At Orion Fintech, when validating a daily batch (fictional study case R280-C028-2), an engineer calls `repartition(200)` before a simple projection on already balanced source partitions. 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.
- DataFrame partitioning and on-disk directory partitioning are different controls; `partitionBy` was not set for the write.
- The configuration controls default shuffle partition planning, not the number of executor processes.
- Output file count follows task/partition structure rather than the actual dataset size.
- Repartitioning introduces an extra shuffle without a downstream distribution requirement.
Explanation
Correct Answer
D:The reported symptom is: An engineer calls `repartition(200)` before a simple projection on already balanced source partitions. Its direct cause is: Repartitioning introduces an extra shuffle without a downstream distribution requirement. Test that conclusion using: Compare physical plans for Exchange nodes and output parity.
Incorrect Answers
A:DataFrame partitioning and on-disk directory partitioning are different controls; `partitionBy` was not set for the write. That explanation needs evidence of another fault. The specific mechanism here is: Repartitioning introduces an extra shuffle without a downstream distribution requirement.
B:The configuration controls default shuffle partition planning, not the number of executor processes. This is not the root cause established for the reported condition: An engineer calls `repartition(200)` before a simple projection on already balanced source partitions. The cause is: Repartitioning introduces an extra shuffle without a downstream distribution requirement.
C:Output file count follows task/partition structure rather than the actual dataset size. This is not the root cause established for the reported condition: An engineer calls `repartition(200)` before a simple projection on already balanced source partitions. The cause is: Repartitioning introduces an extra shuffle without a downstream distribution requirement.
Question 138
At Westfield Insights, when reviewing an incremental load (fictional study case R280-C028-1), an engineer calls `repartition(200)` before a simple projection on already balanced source partitions. 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.
- Inspect resulting directory structure and schema after reading the output.
- Compare effective config, shuffle task count and active executor list.
- Compare physical plans for Exchange nodes and output parity.
- Measure result bytes, partition count and per-file sizes before the write.
Explanation
Correct Answer
C:Diagnose the affected path with: Compare physical plans for Exchange nodes and output parity. This tests the case-specific cause: Repartitioning introduces an extra shuffle without a downstream distribution requirement.
Incorrect Answers
A:Inspect resulting directory structure and schema after reading the output. That does not establish whether the stated cause is present: Repartitioning introduces an extra shuffle without a downstream distribution requirement. The diagnostic is: Compare physical plans for Exchange nodes and output parity.
B:Compare effective config, shuffle task count and active executor list. That does not establish whether the stated cause is present: Repartitioning introduces an extra shuffle without a downstream distribution requirement. The diagnostic is: Compare physical plans for Exchange nodes and output parity.
D:Measure result bytes, partition count and per-file sizes before the write. That does not establish whether the stated cause is present: Repartitioning introduces an extra shuffle without a downstream distribution requirement. The diagnostic is: Compare physical plans for Exchange nodes and output parity.
Question 139
At Mapleford Engineering, before a production rollout (fictional study case R280-C028-2), an engineer calls `repartition(200)` before a simple projection on already balanced source partitions. 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.
- Files are placed under region directories and all rows are preserved.
- The unnecessary shuffle disappears with identical projected rows.
- Shuffle task count matches configuration where applicable, without false executor-allocation assumptions.
- A manageable number of files is written with unchanged rows and schema.
Explanation
Correct Answer
B:A passing check shows: The unnecessary shuffle disappears with identical projected rows. This is evidence for the scoped change: Remove the redundant repartition and retain source parallelism for the narrow projection.
Incorrect Answers
A:Files are placed under region directories and all rows are preserved. The alternative cannot demonstrate that the issue has been corrected: An engineer calls `repartition(200)` before a simple projection on already balanced source partitions. The required result is: The unnecessary shuffle disappears with identical projected rows.
C:Shuffle task count matches configuration where applicable, without false executor-allocation assumptions. The alternative cannot demonstrate that the issue has been corrected: An engineer calls `repartition(200)` before a simple projection on already balanced source partitions. The required result is: The unnecessary shuffle disappears with identical projected rows.
D:A manageable number of files is written with unchanged rows and schema. This is not the observed recovery outcome. Acceptance requires: The unnecessary shuffle disappears with identical projected rows.
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.