Certified Associate Developer for Apache Spark Practice Test 61
Question 600
At Northstar Payments, during a performance incident (fictional study case R280-C120-1), a notebook calls `df.schema()` and fails because schema is an attribute, not an executable method. 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.
- Repair the boundary between distributed and local processing.
- Change ordering for the affected pagination view.
- Correct only the inspection call.
- Replace only the unbounded local row loop.
Explanation
Correct Answer
C:Correct only the inspection call. This limits the change while addressing: PySpark DataFrame APIs distinguish the `schema` property from `printSchema()` method. The expected outcome is: Schema is available without raising a callable error.
Incorrect Answers
A:Repair the boundary between distributed and local processing. The action does not preserve the identified scope boundary: Correct only the inspection call.
B:Change ordering for the affected pagination view. It is not the bounded choice for the stated condition: A notebook calls `df.schema()` and fails because schema is an attribute, not an executable method. The permitted change must remain: Correct only the inspection call.
D:Replace only the unbounded local row loop. This does not enforce the required scope: Correct only the inspection call. The specific failure is: PySpark DataFrame APIs distinguish the `schema` property from `printSchema()` method.
Question 601
At Cloudhaven Apps, while optimizing an ETL application (fictional study case R280-C121-1), an engineer calls `.filter()` on the list returned by `df.collect()` and receives an attribute error. 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.
- Add a deterministic unique secondary key to the sort contract.
- Apply `filter` before the action, or use local list logic only for truly bounded data.
- Rewrite row logic using built-in expressions or appropriate distributed operations.
- Use distributed validations and review aggregate defect counts over the full DataFrame.
Explanation
Correct Answer
B:An engineer calls `.filter()` on the list returned by `df.collect()` and receives an attribute error. The underlying cause is: An action returns local Row objects rather than a lazy DataFrame supporting distributed methods. The corrective step is: Apply `filter` before the action, or use local list logic only for truly bounded data. Validate the outcome: Filtering remains distributed for the large source and returned local sample is bounded.
Incorrect Answers
A:Add a deterministic unique secondary key to the sort contract. The option targets a different stage or condition. The relevant failure is: An action returns local Row objects rather than a lazy DataFrame supporting distributed methods. The needed repair is: Apply `filter` before the action, or use local list logic only for truly bounded data.
C:Rewrite row logic using built-in expressions or appropriate distributed operations. The recorded mechanism is: An action returns local Row objects rather than a lazy DataFrame supporting distributed methods. The proposed action does not correct that mechanism; use: Apply `filter` before the action, or use local list logic only for truly bounded data.
D:Use distributed validations and review aggregate defect counts over the full DataFrame. That would not resolve the reported problem: An engineer calls `.filter()` on the list returned by `df.collect()` and receives an attribute error. The source-supported intervention is: Apply `filter` before the action, or use local list logic only for truly bounded data.
Question 602
At Bayshore Healthcare, during an internal acceptance test (fictional study case R280-C121-2), an engineer calls `.filter()` on the list returned by `df.collect()` and receives an attribute error. 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.
- An action returns local Row objects rather than a lazy DataFrame supporting distributed methods.
- Sorting by a nonunique key does not guarantee stable ordering among ties.
- `collect()` materializes the entire distributed result locally, eliminating partitioned processing.
- `show()` displays a bounded sample rather than validating every partition.
Explanation
Correct Answer
A:The failure is explained by: An action returns local Row objects rather than a lazy DataFrame supporting distributed methods. An engineer calls `.filter()` on the list returned by `df.collect()` and receives an attribute error. Correcting it would require: Apply `filter` before the action, or use local list logic only for truly bounded data.
Incorrect Answers
B:Sorting by a nonunique key does not guarantee stable ordering among ties. This is not the root cause established for the reported condition: An engineer calls `.filter()` on the list returned by `df.collect()` and receives an attribute error. The cause is: An action returns local Row objects rather than a lazy DataFrame supporting distributed methods.
C:`collect()` materializes the entire distributed result locally, eliminating partitioned processing. This is not the root cause established for the reported condition: An engineer calls `.filter()` on the list returned by `df.collect()` and receives an attribute error. The cause is: An action returns local Row objects rather than a lazy DataFrame supporting distributed methods.
D:`show()` displays a bounded sample rather than validating every partition. The observed failure instead follows from: An action returns local Row objects rather than a lazy DataFrame supporting distributed methods. The alternative does not explain the same dependency.
Question 603
At Stonebridge Research, after a routine data refresh (fictional study case R280-C121-1), an engineer calls `.filter()` on the list returned by `df.collect()` and receives an attribute error. 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.
- Repeat page queries on data with equal scores and inspect ID order.
- Measure driver RSS and number of collected rows versus cluster processing.
- Compare displayed rows with full-data failure counts.
- Inspect object types and task execution around the collect boundary.
Explanation
Correct Answer
D:Use this focused test: Inspect object types and task execution around the collect boundary. The test distinguishes the reported condition from alternatives by checking: An action returns local Row objects rather than a lazy DataFrame supporting distributed methods.
Incorrect Answers
A:Repeat page queries on data with equal scores and inspect ID order. The case requires a discriminating check before any change, not the offered alternative. Use: Inspect object types and task execution around the collect boundary.
B:Measure driver RSS and number of collected rows versus cluster processing. This is not the focused evidence-gathering step. Verify the suspected mechanism with: Inspect object types and task execution around the collect boundary.
C:Compare displayed rows with full-data failure counts. This is not the focused evidence-gathering step. Verify the suspected mechanism with: Inspect object types and task execution around the collect boundary.
Question 604
At Cedarline Telecommunications, while debugging a failed notebook (fictional study case R280-C121-2), an engineer calls `.filter()` on the list returned by `df.collect()` and receives an attribute error. 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.
- Pages are stable for a fixed snapshot and no IDs repeat unexpectedly.
- The job completes without a driver OOM and output matches a bounded reference.
- All required rows are checked without pulling them to the driver.
- Filtering remains distributed for the large source and returned local sample is bounded.
Explanation
Correct Answer
D:The verification result must be: Filtering remains distributed for the large source and returned local sample is bounded. It is stronger evidence than merely performing: Inspect object types and task execution around the collect boundary.
Incorrect Answers
A:Pages are stable for a fixed snapshot and no IDs repeat unexpectedly. Implementation or a check alone is not proof of success. The measurable end state is: Filtering remains distributed for the large source and returned local sample is bounded.
B:The job completes without a driver OOM and output matches a bounded reference. Implementation or a check alone is not proof of success. The measurable end state is: Filtering remains distributed for the large source and returned local sample is bounded.
C:All required rows are checked without pulling them to the driver. Implementation or a check alone is not proof of success. The measurable end state is: Filtering remains distributed for the large source and returned local sample is bounded.
Question 605
At Cobalt Analytics, during a performance incident (fictional study case R280-C121-1), an engineer calls `.filter()` on the list returned by `df.collect()` and receives an attribute error. 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 ordering for the affected pagination view.
- Replace only the unbounded local row loop.
- Add validation while preserving normal DataFrame processing.
- Repair the boundary between distributed and local processing.
Explanation
Correct Answer
D:The approved limit is: Repair the boundary between distributed and local processing. It avoids applying the corrective step beyond the stated failure: An engineer calls `.filter()` on the list returned by `df.collect()` and receives an attribute error.
Incorrect Answers
A:Change ordering for the affected pagination view. The action does not preserve the identified scope boundary: Repair the boundary between distributed and local processing.
B:Replace only the unbounded local row loop. It is not the bounded choice for the stated condition: An engineer calls `.filter()` on the list returned by `df.collect()` and receives an attribute error. The permitted change must remain: Repair the boundary between distributed and local processing.
C:Add validation while preserving normal DataFrame processing. This does not enforce the required scope: Repair the boundary between distributed and local processing. The specific failure is: An action returns local Row objects rather than a lazy DataFrame supporting distributed methods.
Question 606
At Summit Supply, while optimizing an ETL application (fictional study case R280-C122-1), a service paginates `orderBy('score')` when thousands of rows share the same score and sees duplicates between pages. 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.
- Rewrite row logic using built-in expressions or appropriate distributed operations.
- Add a deterministic unique secondary key to the sort contract.
- Use distributed validations and review aggregate defect counts over the full DataFrame.
- Use `col('revenue').desc()` and a stable tie-breaker where required.
Explanation
Correct Answer
B:Add a deterministic unique secondary key to the sort contract. The technical or governance gap is: Sorting by a nonunique key does not guarantee stable ordering among ties. Check the affected state using: Repeat page queries on data with equal scores and inspect ID order.
Incorrect Answers
A:Rewrite row logic using built-in expressions or appropriate distributed operations. The option targets a different stage or condition. The relevant failure is: Sorting by a nonunique key does not guarantee stable ordering among ties. The needed repair is: Add a deterministic unique secondary key to the sort contract.
C:Use distributed validations and review aggregate defect counts over the full DataFrame. The recorded mechanism is: Sorting by a nonunique key does not guarantee stable ordering among ties. The proposed action does not correct that mechanism; use: Add a deterministic unique secondary key to the sort contract.
D:Use `col('revenue').desc()` and a stable tie-breaker where required. That would not resolve the reported problem: A service paginates `orderBy('score')` when thousands of rows share the same score and sees duplicates between pages. The source-supported intervention is: Add a deterministic unique secondary key to the sort contract.
Question 607
At Granite Insurance, during an internal acceptance test (fictional study case R280-C122-2), a service paginates `orderBy('score')` when thousands of rows share the same score and sees duplicates between pages. 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.
- `collect()` materializes the entire distributed result locally, eliminating partitioned processing.
- `show()` displays a bounded sample rather than validating every partition.
- `orderBy` defaults to ascending unless descending order is explicit.
- Sorting by a nonunique key does not guarantee stable ordering among ties.
Explanation
Correct Answer
D:Investigation should distinguish this specific mechanism: Sorting by a nonunique key does not guarantee stable ordering among ties. The related symptom is: A service paginates `orderBy('score')` when thousands of rows share the same score and sees duplicates between pages. The discriminating check is: Repeat page queries on data with equal scores and inspect ID order.
Incorrect Answers
A:`collect()` materializes the entire distributed result locally, eliminating partitioned processing. This is not the root cause established for the reported condition: A service paginates `orderBy('score')` when thousands of rows share the same score and sees duplicates between pages. The cause is: Sorting by a nonunique key does not guarantee stable ordering among ties.
B:`show()` displays a bounded sample rather than validating every partition. This is not the root cause established for the reported condition: A service paginates `orderBy('score')` when thousands of rows share the same score and sees duplicates between pages. The cause is: Sorting by a nonunique key does not guarantee stable ordering among ties.
C:`orderBy` defaults to ascending unless descending order is explicit. This is not the root cause established for the reported condition: A service paginates `orderBy('score')` when thousands of rows share the same score and sees duplicates between pages. The cause is: Sorting by a nonunique key does not guarantee stable ordering among ties.
Question 608
At Elmwood Manufacturing, after a routine data refresh (fictional study case R280-C122-1), a service paginates `orderBy('score')` when thousands of rows share the same score and sees duplicates between pages. 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 driver RSS and number of collected rows versus cluster processing.
- Compare displayed rows with full-data failure counts.
- Check fixture rows with known revenue ranks and ties.
- Repeat page queries on data with equal scores and inspect ID order.
Explanation
Correct Answer
D:The needed observation is: Repeat page queries on data with equal scores and inspect ID order. The suspected failure is: Sorting by a nonunique key does not guarantee stable ordering among ties. The repair should only follow that check.
Incorrect Answers
A:Measure driver RSS and number of collected rows versus cluster processing. That does not establish whether the stated cause is present: Sorting by a nonunique key does not guarantee stable ordering among ties. The diagnostic is: Repeat page queries on data with equal scores and inspect ID order.
B:Compare displayed rows with full-data failure counts. The case requires a discriminating check before any change, not the offered alternative. Use: Repeat page queries on data with equal scores and inspect ID order.
C:Check fixture rows with known revenue ranks and ties. That does not establish whether the stated cause is present: Sorting by a nonunique key does not guarantee stable ordering among ties. The diagnostic is: Repeat page queries on data with equal scores and inspect ID order.
Question 609
At Lakeside Devices, while debugging a failed notebook (fictional study case R280-C122-2), a service paginates `orderBy('score')` when thousands of rows share the same score and sees duplicates between pages. 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 job completes without a driver OOM and output matches a bounded reference.
- All required rows are checked without pulling them to the driver.
- Highest revenue appears first with deterministic tie handling.
- Pages are stable for a fixed snapshot and no IDs repeat unexpectedly.
Explanation
Correct Answer
D:Acceptance requires: Pages are stable for a fixed snapshot and no IDs repeat unexpectedly. That directly tests whether the mechanism was corrected: Sorting by a nonunique key does not guarantee stable ordering among ties.
Incorrect Answers
A:The job completes without a driver OOM and output matches a bounded reference. The alternative cannot demonstrate that the issue has been corrected: A service paginates `orderBy('score')` when thousands of rows share the same score and sees duplicates between pages. The required result is: Pages are stable for a fixed snapshot and no IDs repeat unexpectedly.
B:All required rows are checked without pulling them to the driver. This is not the observed recovery outcome. Acceptance requires: Pages are stable for a fixed snapshot and no IDs repeat unexpectedly.
C:Highest revenue appears first with deterministic tie handling. This is not the observed recovery outcome. Acceptance requires: Pages are stable for a fixed snapshot and no IDs repeat unexpectedly.
Question 610
At Bayfront Markets, during a performance incident (fictional study case R280-C122-1), a service paginates `orderBy('score')` when thousands of rows share the same score and sees duplicates between pages. 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.
- Replace only the unbounded local row loop.
- Add validation while preserving normal DataFrame processing.
- Change ordering for the affected pagination view.
- Change the report sort key only.
Explanation
Correct Answer
C:The approved limit is: Change ordering for the affected pagination view. It avoids applying the corrective step beyond the stated failure: A service paginates `orderBy('score')` when thousands of rows share the same score and sees duplicates between pages.
Incorrect Answers
A:Replace only the unbounded local row loop. The action does not preserve the identified scope boundary: Change ordering for the affected pagination view.
B:Add validation while preserving normal DataFrame processing. It is not the bounded choice for the stated condition: A service paginates `orderBy('score')` when thousands of rows share the same score and sees duplicates between pages. The permitted change must remain: Change ordering for the affected pagination view.
D:Change the report sort key only. It is not the bounded choice for the stated condition: A service paginates `orderBy('score')` when thousands of rows share the same score and sees duplicates between pages. The permitted change must remain: Change ordering for the affected pagination view.