Certified Associate Developer for Apache Spark Practice Test 22
Question 210
At Pinecrest Media, after a Spark runtime upgrade (fictional study case R280-C042-1), a 200-country Parquet archive is written as one flat directory, making selective country reads inefficient. 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 the schema to the affected CSV source only.
- Partition only this fact-table extract under the approved database quota.
- Partition the target output path without changing source-country values.
- Correct only this JSON feed's schema and downstream references.
Explanation
Correct Answer
C:The relevant boundary is: Partition the target output path without changing source-country values. The correction remains: Apply `.partitionBy('country')` to the DataFrameWriter and verify the partition directory layout.
Incorrect Answers
A:Apply the schema to the affected CSV source only. This does not enforce the required scope: Partition the target output path without changing source-country values. The specific failure is: The writer omitted `.partitionBy('country')` even though country is a desired output directory partition.
B:Partition only this fact-table extract under the approved database quota. This does not enforce the required scope: Partition the target output path without changing source-country values. The specific failure is: The writer omitted `.partitionBy('country')` even though country is a desired output directory partition.
D:Correct only this JSON feed's schema and downstream references. It is not the bounded choice for the stated condition: A 200-country Parquet archive is written as one flat directory, making selective country reads inefficient. The permitted change must remain: Partition the target output path without changing source-country values.
Question 211
At Ironlake Networks, during a performance incident (fictional study case R280-C043-1), a batch ingests CSV identifiers with leading zeros, and inferred numeric types strip them. 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.
- Configure supported JDBC partition column, bounds, and partition count with source database capacity limits.
- Define or revise the nested Spark schema against representative raw JSON structures.
- Define an explicit `StructType` schema that stores identifier fields as strings.
- Read with the supported text source and parse the message explicitly when required.
Explanation
Correct Answer
C:The failure mechanism is: Automatic CSV schema inference treated business IDs as numeric measurements. Apply the bounded change: Define an explicit `StructType` schema that stores identifier fields as strings. The acceptance test must show: Identifiers retain leading zeros and other fields conform to schema.
Incorrect Answers
A:Configure supported JDBC partition column, bounds, and partition count with source database capacity limits. The option targets a different stage or condition. The relevant failure is: Automatic CSV schema inference treated business IDs as numeric measurements. The needed repair is: Define an explicit `StructType` schema that stores identifier fields as strings.
B:Define or revise the nested Spark schema against representative raw JSON structures. That would not resolve the reported problem: A batch ingests CSV identifiers with leading zeros, and inferred numeric types strip them. The source-supported intervention is: Define an explicit `StructType` schema that stores identifier fields as strings.
D:Read with the supported text source and parse the message explicitly when required. The recorded mechanism is: Automatic CSV schema inference treated business IDs as numeric measurements. The proposed action does not correct that mechanism; use: Define an explicit `StructType` schema that stores identifier fields as strings.
Question 212
At Valleywide Travel, during a distributed-job recovery test (fictional study case R280-C043-2), a batch ingests CSV identifiers with leading zeros, and inferred numeric types strip them. 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.
- JDBC partitioning options were omitted, preventing bounded parallel range reads.
- The supplied schema does not match the actual `struct` and array nesting of the source records.
- The source format selection does not match the actual unstructured line-based input.
- Automatic CSV schema inference treated business IDs as numeric measurements.
Explanation
Correct Answer
D:The failure is explained by: Automatic CSV schema inference treated business IDs as numeric measurements. A batch ingests CSV identifiers with leading zeros, and inferred numeric types strip them. Correcting it would require: Define an explicit `StructType` schema that stores identifier fields as strings.
Incorrect Answers
A:JDBC partitioning options were omitted, preventing bounded parallel range reads. That explanation needs evidence of another fault. The specific mechanism here is: Automatic CSV schema inference treated business IDs as numeric measurements.
B:The supplied schema does not match the actual `struct` and array nesting of the source records. That explanation needs evidence of another fault. The specific mechanism here is: Automatic CSV schema inference treated business IDs as numeric measurements.
C:The source format selection does not match the actual unstructured line-based input. This is not the root cause established for the reported condition: A batch ingests CSV identifiers with leading zeros, and inferred numeric types strip them. The cause is: Automatic CSV schema inference treated business IDs as numeric measurements.
Question 213
At Harbor Data Labs, while reconciling a reporting dataset (fictional study case R280-C043-1), a batch ingests CSV identifiers with leading zeros, and inferred numeric types strip them. 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 JDBC read task count, query predicates and source connection load.
- Inspect raw JSON paths, `printSchema()` and sample nested field extraction.
- Compare raw line bytes against the loaded DataFrame's single `value` column.
- Compare raw CSV samples with inferred types and explicit-schema readback.
Explanation
Correct Answer
D:Compare raw CSV samples with inferred types and explicit-schema readback. This gathers evidence about the stated mechanism: Automatic CSV schema inference treated business IDs as numeric measurements. The existing symptom is: A batch ingests CSV identifiers with leading zeros, and inferred numeric types strip them.
Incorrect Answers
A:Inspect JDBC read task count, query predicates and source connection load. That does not establish whether the stated cause is present: Automatic CSV schema inference treated business IDs as numeric measurements. The diagnostic is: Compare raw CSV samples with inferred types and explicit-schema readback.
B:Inspect raw JSON paths, `printSchema()` and sample nested field extraction. This is not the focused evidence-gathering step. Verify the suspected mechanism with: Compare raw CSV samples with inferred types and explicit-schema readback.
C:Compare raw line bytes against the loaded DataFrame's single `value` column. That does not establish whether the stated cause is present: Automatic CSV schema inference treated business IDs as numeric measurements. The diagnostic is: Compare raw CSV samples with inferred types and explicit-schema readback.
Question 214
At Oakline Transportation, during a pipeline migration (fictional study case R280-C043-2), a batch ingests CSV identifiers with leading zeros, and inferred numeric types strip them. 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 extract completes with stable database load and no missing or overlapping rows.
- Valid nested attributes appear at the correct paths without inventing missing values.
- Identifiers retain leading zeros and other fields conform to schema.
- One source line becomes one expected record with intact content.
Explanation
Correct Answer
C:Acceptance requires: Identifiers retain leading zeros and other fields conform to schema. That directly tests whether the mechanism was corrected: Automatic CSV schema inference treated business IDs as numeric measurements.
Incorrect Answers
A:The extract completes with stable database load and no missing or overlapping rows. This is not the observed recovery outcome. Acceptance requires: Identifiers retain leading zeros and other fields conform to schema.
B:Valid nested attributes appear at the correct paths without inventing missing values. The alternative cannot demonstrate that the issue has been corrected: A batch ingests CSV identifiers with leading zeros, and inferred numeric types strip them. The required result is: Identifiers retain leading zeros and other fields conform to schema.
D:One source line becomes one expected record with intact content. Implementation or a check alone is not proof of success. The measurable end state is: Identifiers retain leading zeros and other fields conform to schema.
Question 215
At Rosehill Diagnostics, after a Spark runtime upgrade (fictional study case R280-C043-1), a batch ingests CSV identifiers with leading zeros, and inferred numeric types strip them. 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 the schema to the affected CSV source only.
- Partition only this fact-table extract under the approved database quota.
- Correct only this JSON feed's schema and downstream references.
- Change the reader for this text input, not unrelated CSV jobs.
Explanation
Correct Answer
A:The approved limit is: Apply the schema to the affected CSV source only. It avoids applying the corrective step beyond the stated failure: A batch ingests CSV identifiers with leading zeros, and inferred numeric types strip them.
Incorrect Answers
B:Partition only this fact-table extract under the approved database quota. The action does not preserve the identified scope boundary: Apply the schema to the affected CSV source only.
C:Correct only this JSON feed's schema and downstream references. The action does not preserve the identified scope boundary: Apply the schema to the affected CSV source only.
D:Change the reader for this text input, not unrelated CSV jobs. The action does not preserve the identified scope boundary: Apply the schema to the affected CSV source only.
Question 216
At Redwood Transit, during a performance incident (fictional study case R280-C044-1), a large relational source read uses one JDBC partition and monopolizes a single database connection for hours. 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.
- Define or revise the nested Spark schema against representative raw JSON structures.
- Read with the supported text source and parse the message explicitly when required.
- Use supported schema merging where justified or normalize files to an explicit canonical schema.
- Configure supported JDBC partition column, bounds, and partition count with source database capacity limits.
Explanation
Correct Answer
D:The failure mechanism is: JDBC partitioning options were omitted, preventing bounded parallel range reads. Apply the bounded change: Configure supported JDBC partition column, bounds, and partition count with source database capacity limits. The acceptance test must show: The extract completes with stable database load and no missing or overlapping rows.
Incorrect Answers
A:Define or revise the nested Spark schema against representative raw JSON structures. That would not resolve the reported problem: A large relational source read uses one JDBC partition and monopolizes a single database connection for hours. The source-supported intervention is: Configure supported JDBC partition column, bounds, and partition count with source database capacity limits.
B:Read with the supported text source and parse the message explicitly when required. That would not resolve the reported problem: A large relational source read uses one JDBC partition and monopolizes a single database connection for hours. The source-supported intervention is: Configure supported JDBC partition column, bounds, and partition count with source database capacity limits.
C:Use supported schema merging where justified or normalize files to an explicit canonical schema. The option targets a different stage or condition. The relevant failure is: JDBC partitioning options were omitted, preventing bounded parallel range reads. The needed repair is: Configure supported JDBC partition column, bounds, and partition count with source database capacity limits.
Question 217
At Meadowvale Robotics, during a distributed-job recovery test (fictional study case R280-C044-2), a large relational source read uses one JDBC partition and monopolizes a single database connection for hours. 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 supplied schema does not match the actual `struct` and array nesting of the source records.
- JDBC partitioning options were omitted, preventing bounded parallel range reads.
- The source format selection does not match the actual unstructured line-based input.
- Automatic schema inference on heterogeneous Parquet parts did not merge relevant schemas.
Explanation
Correct Answer
B:JDBC partitioning options were omitted, preventing bounded parallel range reads. This accounts for the observed condition: A large relational source read uses one JDBC partition and monopolizes a single database connection for hours. The relevant verification is: Inspect JDBC read task count, query predicates and source connection load.
Incorrect Answers
A:The supplied schema does not match the actual `struct` and array nesting of the source records. The observed failure instead follows from: JDBC partitioning options were omitted, preventing bounded parallel range reads. The alternative does not explain the same dependency.
C:The source format selection does not match the actual unstructured line-based input. That explanation needs evidence of another fault. The specific mechanism here is: JDBC partitioning options were omitted, preventing bounded parallel range reads.
D:Automatic schema inference on heterogeneous Parquet parts did not merge relevant schemas. The observed failure instead follows from: JDBC partitioning options were omitted, preventing bounded parallel range reads. The alternative does not explain the same dependency.
Question 218
At Northridge Retail, while reconciling a reporting dataset (fictional study case R280-C044-1), a large relational source read uses one JDBC partition and monopolizes a single database connection for hours. 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 JDBC read task count, query predicates and source connection load.
- Inspect raw JSON paths, `printSchema()` and sample nested field extraction.
- Compare raw line bytes against the loaded DataFrame's single `value` column.
- Compare sampled file schemas and merged DataFrame output.
Explanation
Correct Answer
A:Diagnose the affected path with: Inspect JDBC read task count, query predicates and source connection load. This tests the case-specific cause: JDBC partitioning options were omitted, preventing bounded parallel range reads.
Incorrect Answers
B:Inspect raw JSON paths, `printSchema()` and sample nested field extraction. That does not establish whether the stated cause is present: JDBC partitioning options were omitted, preventing bounded parallel range reads. The diagnostic is: Inspect JDBC read task count, query predicates and source connection load.
C:Compare raw line bytes against the loaded DataFrame's single `value` column. This is not the focused evidence-gathering step. Verify the suspected mechanism with: Inspect JDBC read task count, query predicates and source connection load.
D:Compare sampled file schemas and merged DataFrame output. This is not the focused evidence-gathering step. Verify the suspected mechanism with: Inspect JDBC read task count, query predicates and source connection load.
Question 219
At Northstar Payments, during a pipeline migration (fictional study case R280-C044-2), a large relational source read uses one JDBC partition and monopolizes a single database connection for hours. 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.
- Valid nested attributes appear at the correct paths without inventing missing values.
- One source line becomes one expected record with intact content.
- All intended historical columns remain queryable with expected nulls for older records.
- The extract completes with stable database load and no missing or overlapping rows.
Explanation
Correct Answer
D:The extract completes with stable database load and no missing or overlapping rows. This demonstrates the intended effect of: Configure supported JDBC partition column, bounds, and partition count with source database capacity limits. The prior failure was: A large relational source read uses one JDBC partition and monopolizes a single database connection for hours.
Incorrect Answers
A:Valid nested attributes appear at the correct paths without inventing missing values. This is not the observed recovery outcome. Acceptance requires: The extract completes with stable database load and no missing or overlapping rows.
B:One source line becomes one expected record with intact content. Implementation or a check alone is not proof of success. The measurable end state is: The extract completes with stable database load and no missing or overlapping rows.
C:All intended historical columns remain queryable with expected nulls for older records. Implementation or a check alone is not proof of success. The measurable end state is: The extract completes with stable database load and no missing or overlapping rows.
Question 220
At Cloudhaven Apps, after a Spark runtime upgrade (fictional study case R280-C044-1), a large relational source read uses one JDBC partition and monopolizes a single database connection for hours. 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.
- Correct only this JSON feed's schema and downstream references.
- Change the reader for this text input, not unrelated CSV jobs.
- Reconcile the affected evolving dataset only.
- Partition only this fact-table extract under the approved database quota.
Explanation
Correct Answer
D:Keep the intervention within this boundary: Partition only this fact-table extract under the approved database quota. The reported failure mechanism is: JDBC partitioning options were omitted, preventing bounded parallel range reads.
Incorrect Answers
A:Correct only this JSON feed's schema and downstream references. The action does not preserve the identified scope boundary: Partition only this fact-table extract under the approved database quota.
B:Change the reader for this text input, not unrelated CSV jobs. It is not the bounded choice for the stated condition: A large relational source read uses one JDBC partition and monopolizes a single database connection for hours. The permitted change must remain: Partition only this fact-table extract under the approved database quota.
C:Reconcile the affected evolving dataset only. The action does not preserve the identified scope boundary: Partition only this fact-table extract under the approved database quota.