Certified Associate Developer for Apache Spark Practice Test 57
Question 560
At Ironlake Networks, when reviewing an incremental load (fictional study case R280-C112-1), a daily job uses full-table overwrite when only a single date partition was refreshed. 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 only the finance value's schema mapping.
- Apply schema evolution only to the named dataset.
- Correct the serialization for this export only.
- Constrain changes to the intended table partition.
Explanation
Correct Answer
D:The approved limit is: Constrain changes to the intended table partition. It avoids applying the corrective step beyond the stated failure: A daily job uses full-table overwrite when only a single date partition was refreshed.
Incorrect Answers
A:Change only the finance value's schema mapping. The action does not preserve the identified scope boundary: Constrain changes to the intended table partition.
B:Apply schema evolution only to the named dataset. This does not enforce the required scope: Constrain changes to the intended table partition. The specific failure is: The write operation's overwrite scope is broader than the replacement partition.
C:Correct the serialization for this export only. The action does not preserve the identified scope boundary: Constrain changes to the intended table partition.
Question 561
At Valleywide Travel, while reconciling a reporting dataset (fictional study case R280-C113-1), a source decimal with cents is cast to integer, silently losing fractional currency amounts. 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.
- Align incoming columns to the target schema or use explicit supported schema evolution after approval.
- Write with the Parquet DataFrameWriter format and validate by reading it back as Parquet.
- Use a suitable `DecimalType(precision, scale)` with validation before calculation and writing.
- Validate the mandatory ID column and quarantine bad records before writing.
Explanation
Correct Answer
C:The observed defect follows from: Chosen Spark type lacks the required decimal scale. The appropriate correction is: Use a suitable `DecimalType(precision, scale)` with validation before calculation and writing. Confirm the result by verifying: Monetary values retain correct precision across read and write.
Incorrect Answers
A:Align incoming columns to the target schema or use explicit supported schema evolution after approval. The option targets a different stage or condition. The relevant failure is: Chosen Spark type lacks the required decimal scale. The needed repair is: Use a suitable `DecimalType(precision, scale)` with validation before calculation and writing.
B:Write with the Parquet DataFrameWriter format and validate by reading it back as Parquet. The recorded mechanism is: Chosen Spark type lacks the required decimal scale. The proposed action does not correct that mechanism; use: Use a suitable `DecimalType(precision, scale)` with validation before calculation and writing.
D:Validate the mandatory ID column and quarantine bad records before writing. The option targets a different stage or condition. The relevant failure is: Chosen Spark type lacks the required decimal scale. The needed repair is: Use a suitable `DecimalType(precision, scale)` with validation before calculation and writing.
Question 562
At Harbor Data Labs, during a pipeline migration (fictional study case R280-C113-2), a source decimal with cents is cast to integer, silently losing fractional currency amounts. 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.
- Chosen Spark type lacks the required decimal scale.
- The destination schema contract was not reconciled before appending evolved records.
- File extension and directory naming do not determine the actual serialization format.
- The write path did not enforce the schema and quality constraints required by the downstream contract.
Explanation
Correct Answer
A:Chosen Spark type lacks the required decimal scale. This accounts for the observed condition: A source decimal with cents is cast to integer, silently losing fractional currency amounts. The relevant verification is: Compare raw decimal inputs with typed output on cent-level fixtures.
Incorrect Answers
B:The destination schema contract was not reconciled before appending evolved records. That explanation needs evidence of another fault. The specific mechanism here is: Chosen Spark type lacks the required decimal scale.
C:File extension and directory naming do not determine the actual serialization format. The observed failure instead follows from: Chosen Spark type lacks the required decimal scale. The alternative does not explain the same dependency.
D:The write path did not enforce the schema and quality constraints required by the downstream contract. The observed failure instead follows from: Chosen Spark type lacks the required decimal scale. The alternative does not explain the same dependency.
Question 563
At Oakline Transportation, after a Spark runtime upgrade (fictional study case R280-C113-1), a source decimal with cents is cast to integer, silently losing fractional currency amounts. 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.
- Diff incoming and existing schemas and test append on a staging copy.
- Inspect file footers and source writer invocation.
- Compare raw decimal inputs with typed output on cent-level fixtures.
- Count null/missing transaction IDs in staged input.
Explanation
Correct Answer
C:The needed observation is: Compare raw decimal inputs with typed output on cent-level fixtures. The suspected failure is: Chosen Spark type lacks the required decimal scale. The repair should only follow that check.
Incorrect Answers
A:Diff incoming and existing schemas and test append on a staging copy. The case requires a discriminating check before any change, not the offered alternative. Use: Compare raw decimal inputs with typed output on cent-level fixtures.
B:Inspect file footers and source writer invocation. The case requires a discriminating check before any change, not the offered alternative. Use: Compare raw decimal inputs with typed output on cent-level fixtures.
D:Count null/missing transaction IDs in staged input. The case requires a discriminating check before any change, not the offered alternative. Use: Compare raw decimal inputs with typed output on cent-level fixtures.
Question 564
At Rosehill Diagnostics, when validating a daily batch (fictional study case R280-C113-2), a source decimal with cents is cast to integer, silently losing fractional currency amounts. 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.
- Monetary values retain correct precision across read and write.
- New records append without corrupting old fields.
- Output is readable through the required format with complete schema.
- All written events contain valid IDs and rejected records remain auditable.
Explanation
Correct Answer
A:Monetary values retain correct precision across read and write. This is an observable state after the correction: Use a suitable `DecimalType(precision, scale)` with validation before calculation and writing. It confirms the original problem no longer occurs.
Incorrect Answers
B:New records append without corrupting old fields. The alternative cannot demonstrate that the issue has been corrected: A source decimal with cents is cast to integer, silently losing fractional currency amounts. The required result is: Monetary values retain correct precision across read and write.
C:Output is readable through the required format with complete schema. This is not the observed recovery outcome. Acceptance requires: Monetary values retain correct precision across read and write.
D:All written events contain valid IDs and rejected records remain auditable. This is not the observed recovery outcome. Acceptance requires: Monetary values retain correct precision across read and write.
Question 565
At Redwood Transit, when reviewing an incremental load (fictional study case R280-C113-1), a source decimal with cents is cast to integer, silently losing fractional currency amounts. 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 only the finance value's schema mapping.
- Apply schema evolution only to the named dataset.
- Correct the serialization for this export only.
- Add validation to the affected sink pipeline.
Explanation
Correct Answer
A:The relevant boundary is: Change only the finance value's schema mapping. The correction remains: Use a suitable `DecimalType(precision, scale)` with validation before calculation and writing.
Incorrect Answers
B:Apply schema evolution only to the named dataset. It is not the bounded choice for the stated condition: A source decimal with cents is cast to integer, silently losing fractional currency amounts. The permitted change must remain: Change only the finance value's schema mapping.
C:Correct the serialization for this export only. This does not enforce the required scope: Change only the finance value's schema mapping. The specific failure is: Chosen Spark type lacks the required decimal scale.
D:Add validation to the affected sink pipeline. The action does not preserve the identified scope boundary: Change only the finance value's schema mapping.
Question 566
At Meadowvale Robotics, while reconciling a reporting dataset (fictional study case R280-C114-1), a newer batch includes an additional optional field that conflicts with a fixed persisted schema. 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.
- Align incoming columns to the target schema or use explicit supported schema evolution after approval.
- Write with the Parquet DataFrameWriter format and validate by reading it back as Parquet.
- Validate the mandatory ID column and quarantine bad records before writing.
- Supply a canonical explicit schema with the ID stored as string and validate input types.
Explanation
Correct Answer
A:Align incoming columns to the target schema or use explicit supported schema evolution after approval. The technical or governance gap is: The destination schema contract was not reconciled before appending evolved records. Check the affected state using: Diff incoming and existing schemas and test append on a staging copy.
Incorrect Answers
B:Write with the Parquet DataFrameWriter format and validate by reading it back as Parquet. The recorded mechanism is: The destination schema contract was not reconciled before appending evolved records. The proposed action does not correct that mechanism; use: Align incoming columns to the target schema or use explicit supported schema evolution after approval.
C:Validate the mandatory ID column and quarantine bad records before writing. That would not resolve the reported problem: A newer batch includes an additional optional field that conflicts with a fixed persisted schema. The source-supported intervention is: Align incoming columns to the target schema or use explicit supported schema evolution after approval.
D:Supply a canonical explicit schema with the ID stored as string and validate input types. That would not resolve the reported problem: A newer batch includes an additional optional field that conflicts with a fixed persisted schema. The source-supported intervention is: Align incoming columns to the target schema or use explicit supported schema evolution after approval.
Question 567
At Northridge Retail, during a pipeline migration (fictional study case R280-C114-2), a newer batch includes an additional optional field that conflicts with a fixed persisted schema. 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.
- File extension and directory naming do not determine the actual serialization format.
- The write path did not enforce the schema and quality constraints required by the downstream contract.
- The destination schema contract was not reconciled before appending evolved records.
- Schema inference across heterogeneous files does not guarantee a consistent business-key type.
Explanation
Correct Answer
C:A newer batch includes an additional optional field that conflicts with a fixed persisted schema. The supporting root cause is: The destination schema contract was not reconciled before appending evolved records. The appropriate remedy is: Align incoming columns to the target schema or use explicit supported schema evolution after approval.
Incorrect Answers
A:File extension and directory naming do not determine the actual serialization format. This is not the root cause established for the reported condition: A newer batch includes an additional optional field that conflicts with a fixed persisted schema. The cause is: The destination schema contract was not reconciled before appending evolved records.
B:The write path did not enforce the schema and quality constraints required by the downstream contract. That explanation needs evidence of another fault. The specific mechanism here is: The destination schema contract was not reconciled before appending evolved records.
D:Schema inference across heterogeneous files does not guarantee a consistent business-key type. The observed failure instead follows from: The destination schema contract was not reconciled before appending evolved records. The alternative does not explain the same dependency.
Question 568
At Northstar Payments, after a Spark runtime upgrade (fictional study case R280-C114-1), a newer batch includes an additional optional field that conflicts with a fixed persisted schema. 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.
- Diff incoming and existing schemas and test append on a staging copy.
- Inspect file footers and source writer invocation.
- Count null/missing transaction IDs in staged input.
- Compare `printSchema()` across file partitions and expected ID samples.
Explanation
Correct Answer
A:A newer batch includes an additional optional field that conflicts with a fixed persisted schema. The useful diagnostic is: Diff incoming and existing schemas and test append on a staging copy. That can confirm or refute: The destination schema contract was not reconciled before appending evolved records.
Incorrect Answers
B:Inspect file footers and source writer invocation. That does not establish whether the stated cause is present: The destination schema contract was not reconciled before appending evolved records. The diagnostic is: Diff incoming and existing schemas and test append on a staging copy.
C:Count null/missing transaction IDs in staged input. That does not establish whether the stated cause is present: The destination schema contract was not reconciled before appending evolved records. The diagnostic is: Diff incoming and existing schemas and test append on a staging copy.
D:Compare `printSchema()` across file partitions and expected ID samples. This is not the focused evidence-gathering step. Verify the suspected mechanism with: Diff incoming and existing schemas and test append on a staging copy.
Question 569
At Cloudhaven Apps, when validating a daily batch (fictional study case R280-C114-2), a newer batch includes an additional optional field that conflicts with a fixed persisted schema. 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.
- Output is readable through the required format with complete schema.
- New records append without corrupting old fields.
- All written events contain valid IDs and rejected records remain auditable.
- Combined files preserve all IDs consistently.
Explanation
Correct Answer
B:New records append without corrupting old fields. This is an observable state after the correction: Align incoming columns to the target schema or use explicit supported schema evolution after approval. It confirms the original problem no longer occurs.
Incorrect Answers
A:Output is readable through the required format with complete schema. Implementation or a check alone is not proof of success. The measurable end state is: New records append without corrupting old fields.
C:All written events contain valid IDs and rejected records remain auditable. The alternative cannot demonstrate that the issue has been corrected: A newer batch includes an additional optional field that conflicts with a fixed persisted schema. The required result is: New records append without corrupting old fields.
D:Combined files preserve all IDs consistently. Implementation or a check alone is not proof of success. The measurable end state is: New records append without corrupting old fields.
Question 570
At Bayshore Healthcare, when reviewing an incremental load (fictional study case R280-C114-1), a newer batch includes an additional optional field that conflicts with a fixed persisted schema. 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 schema evolution only to the named dataset.
- Correct the serialization for this export only.
- Add validation to the affected sink pipeline.
- Fix schema only for the member feed.
Explanation
Correct Answer
A:The approved limit is: Apply schema evolution only to the named dataset. It avoids applying the corrective step beyond the stated failure: A newer batch includes an additional optional field that conflicts with a fixed persisted schema.
Incorrect Answers
B:Correct the serialization for this export only. It is not the bounded choice for the stated condition: A newer batch includes an additional optional field that conflicts with a fixed persisted schema. The permitted change must remain: Apply schema evolution only to the named dataset.
C:Add validation to the affected sink pipeline. The action does not preserve the identified scope boundary: Apply schema evolution only to the named dataset.
D:Fix schema only for the member feed. The action does not preserve the identified scope boundary: Apply schema evolution only to the named dataset.