Certified Associate Developer for Apache Spark Practice Test 36
Question 350
At Stonebridge Research, while optimizing an ETL application (fictional study case R280-C070-1), a table export globally sorts by a two-value flag, causing a large shuffle but little benefit to later lookups. 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 table sort strategy after measuring the affected reports.
- Persist only the shared reporting relation.
- Rebuild partitioning only for this reporting table.
- Tune this table's layout; do not invent unsupported indexing semantics.
Explanation
Correct Answer
A:The relevant boundary is: Change table sort strategy after measuring the affected reports. The correction remains: Remove the unjustified global sort or choose a better-supported layout keyed to actual query filters.
Incorrect Answers
B:Persist only the shared reporting relation. The action does not preserve the identified scope boundary: Change table sort strategy after measuring the affected reports.
C:Rebuild partitioning only for this reporting table. This does not enforce the required scope: Change table sort strategy after measuring the affected reports. The specific failure is: Global sorting is expensive and the key does not provide useful retrieval clustering.
D:Tune this table's layout; do not invent unsupported indexing semantics. This does not enforce the required scope: Change table sort strategy after measuring the affected reports. The specific failure is: Global sorting is expensive and the key does not provide useful retrieval clustering.
Question 351
At Cedarline Telecommunications, when reviewing an incremental load (fictional study case R280-C071-1), a new notebook tries `SELECT * FROM clean_orders` after a different SparkSession registered a local temp view with that name. 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 `createOrReplaceTempView` when intentional replacement is part of the workflow.
- Register the DataFrame in the current session or persist a table for cross-session sharing.
- Call `df.createOrReplaceTempView('events')` and query the registered relation name.
- Query `global_temp.view_name` from sessions in the same Spark application where the view exists.
Explanation
Correct Answer
B:A new notebook tries `SELECT * FROM clean_orders` after a different SparkSession registered a local temp view with that name. The underlying cause is: Local temporary views belong to the creating session's catalog scope. The corrective step is: Register the DataFrame in the current session or persist a table for cross-session sharing. Validate the outcome: The intended query runs in the correct session or persistent catalog.
Incorrect Answers
A:Use `createOrReplaceTempView` when intentional replacement is part of the workflow. The recorded mechanism is: Local temporary views belong to the creating session's catalog scope. The proposed action does not correct that mechanism; use: Register the DataFrame in the current session or persist a table for cross-session sharing.
C:Call `df.createOrReplaceTempView('events')` and query the registered relation name. The option targets a different stage or condition. The relevant failure is: Local temporary views belong to the creating session's catalog scope. The needed repair is: Register the DataFrame in the current session or persist a table for cross-session sharing.
D:Query `global_temp.view_name` from sessions in the same Spark application where the view exists. The option targets a different stage or condition. The relevant failure is: Local temporary views belong to the creating session's catalog scope. The needed repair is: Register the DataFrame in the current session or persist a table for cross-session sharing.
Question 352
At Cobalt Analytics, before a production rollout (fictional study case R280-C071-2), a new notebook tries `SELECT * FROM clean_orders` after a different SparkSession registered a local temp view with that name. 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 registration method rejects duplicate names, unlike `createOrReplaceTempView`.
- Python variable names are not automatically Spark SQL catalog identifiers.
- Global temporary views reside in the `global_temp` database and require a qualified name.
- Local temporary views belong to the creating session's catalog scope.
Explanation
Correct Answer
D:The reported symptom is: A new notebook tries `SELECT * FROM clean_orders` after a different SparkSession registered a local temp view with that name. Its direct cause is: Local temporary views belong to the creating session's catalog scope. Test that conclusion using: List temp views in each session and compare table-not-found errors.
Incorrect Answers
A:The registration method rejects duplicate names, unlike `createOrReplaceTempView`. The observed failure instead follows from: Local temporary views belong to the creating session's catalog scope. The alternative does not explain the same dependency.
B:Python variable names are not automatically Spark SQL catalog identifiers. That explanation needs evidence of another fault. The specific mechanism here is: Local temporary views belong to the creating session's catalog scope.
C:Global temporary views reside in the `global_temp` database and require a qualified name. The observed failure instead follows from: Local temporary views belong to the creating session's catalog scope. The alternative does not explain the same dependency.
Question 353
At Summit Supply, while optimizing an ETL application (fictional study case R280-C071-1), a new notebook tries `SELECT * FROM clean_orders` after a different SparkSession registered a local temp view with that name. 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.
- Run the notebook twice and inspect registration errors and view contents.
- Inspect Spark SQL catalog and reproduce the missing-table error before registration.
- List temp views in each session and compare table-not-found errors.
- Inspect `global_temp` catalog entries and both qualified and unqualified queries.
Explanation
Correct Answer
C:The needed observation is: List temp views in each session and compare table-not-found errors. The suspected failure is: Local temporary views belong to the creating session's catalog scope. The repair should only follow that check.
Incorrect Answers
A:Run the notebook twice and inspect registration errors and view contents. The case requires a discriminating check before any change, not the offered alternative. Use: List temp views in each session and compare table-not-found errors.
B:Inspect Spark SQL catalog and reproduce the missing-table error before registration. This is not the focused evidence-gathering step. Verify the suspected mechanism with: List temp views in each session and compare table-not-found errors.
D:Inspect `global_temp` catalog entries and both qualified and unqualified queries. The case requires a discriminating check before any change, not the offered alternative. Use: List temp views in each session and compare table-not-found errors.
Question 354
At Granite Insurance, during an internal acceptance test (fictional study case R280-C071-2), a new notebook tries `SELECT * FROM clean_orders` after a different SparkSession registered a local temp view with that name. 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.
- Subsequent executions use the new DataFrame data without duplicate-name failure.
- The intended query runs in the correct session or persistent catalog.
- SQL can query the intended DataFrame by the declared view name.
- The shared global temp view resolves correctly while still remaining application-scoped.
Explanation
Correct Answer
B:A passing check shows: The intended query runs in the correct session or persistent catalog. This is evidence for the scoped change: Register the DataFrame in the current session or persist a table for cross-session sharing.
Incorrect Answers
A:Subsequent executions use the new DataFrame data without duplicate-name failure. This is not the observed recovery outcome. Acceptance requires: The intended query runs in the correct session or persistent catalog.
C:SQL can query the intended DataFrame by the declared view name. The alternative cannot demonstrate that the issue has been corrected: A new notebook tries `SELECT * FROM clean_orders` after a different SparkSession registered a local temp view with that name. The required result is: The intended query runs in the correct session or persistent catalog.
D:The shared global temp view resolves correctly while still remaining application-scoped. This is not the observed recovery outcome. Acceptance requires: The intended query runs in the correct session or persistent catalog.
Question 355
At Elmwood Manufacturing, after a routine data refresh (fictional study case R280-C071-1), a new notebook tries `SELECT * FROM clean_orders` after a different SparkSession registered a local temp view with that name. 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 view registration for the affected notebook only.
- Replace only the designated temporary view.
- Register only the needed relation in the current session.
- Change SQL name qualification without claiming persistence across applications.
Explanation
Correct Answer
A:Change view registration for the affected notebook only. This limits the change while addressing: Local temporary views belong to the creating session's catalog scope. The expected outcome is: The intended query runs in the correct session or persistent catalog.
Incorrect Answers
B:Replace only the designated temporary view. This does not enforce the required scope: Change view registration for the affected notebook only. The specific failure is: Local temporary views belong to the creating session's catalog scope.
C:Register only the needed relation in the current session. The action does not preserve the identified scope boundary: Change view registration for the affected notebook only.
D:Change SQL name qualification without claiming persistence across applications. This does not enforce the required scope: Change view registration for the affected notebook only. The specific failure is: Local temporary views belong to the creating session's catalog scope.
Question 356
At Lakeside Devices, when reviewing an incremental load (fictional study case R280-C072-1), a notebook rerun fails when attempting to register an already existing temporary view with `createTempView`. 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.
- Call `df.createOrReplaceTempView('events')` and query the registered relation name.
- Use `createOrReplaceTempView` when intentional replacement is part of the workflow.
- Query `global_temp.view_name` from sessions in the same Spark application where the view exists.
- Configure a supported stream checkpoint location and manage view lifecycle separately.
Explanation
Correct Answer
B:The observed defect follows from: The registration method rejects duplicate names, unlike `createOrReplaceTempView`. The appropriate correction is: Use `createOrReplaceTempView` when intentional replacement is part of the workflow. Confirm the result by verifying: Subsequent executions use the new DataFrame data without duplicate-name failure.
Incorrect Answers
A:Call `df.createOrReplaceTempView('events')` and query the registered relation name. That would not resolve the reported problem: A notebook rerun fails when attempting to register an already existing temporary view with `createTempView`. The source-supported intervention is: Use `createOrReplaceTempView` when intentional replacement is part of the workflow.
C:Query `global_temp.view_name` from sessions in the same Spark application where the view exists. That would not resolve the reported problem: A notebook rerun fails when attempting to register an already existing temporary view with `createTempView`. The source-supported intervention is: Use `createOrReplaceTempView` when intentional replacement is part of the workflow.
D:Configure a supported stream checkpoint location and manage view lifecycle separately. That would not resolve the reported problem: A notebook rerun fails when attempting to register an already existing temporary view with `createTempView`. The source-supported intervention is: Use `createOrReplaceTempView` when intentional replacement is part of the workflow.
Question 357
At Bayfront Markets, before a production rollout (fictional study case R280-C072-2), a notebook rerun fails when attempting to register an already existing temporary view with `createTempView`. 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.
- Python variable names are not automatically Spark SQL catalog identifiers.
- Global temporary views reside in the `global_temp` database and require a qualified name.
- View registration is a query namespace feature, not a durable streaming state checkpoint.
- The registration method rejects duplicate names, unlike `createOrReplaceTempView`.
Explanation
Correct Answer
D:A notebook rerun fails when attempting to register an already existing temporary view with `createTempView`. The supporting root cause is: The registration method rejects duplicate names, unlike `createOrReplaceTempView`. The appropriate remedy is: Use `createOrReplaceTempView` when intentional replacement is part of the workflow.
Incorrect Answers
A:Python variable names are not automatically Spark SQL catalog identifiers. The observed failure instead follows from: The registration method rejects duplicate names, unlike `createOrReplaceTempView`. The alternative does not explain the same dependency.
B:Global temporary views reside in the `global_temp` database and require a qualified name. This is not the root cause established for the reported condition: A notebook rerun fails when attempting to register an already existing temporary view with `createTempView`. The cause is: The registration method rejects duplicate names, unlike `createOrReplaceTempView`.
C:View registration is a query namespace feature, not a durable streaming state checkpoint. The observed failure instead follows from: The registration method rejects duplicate names, unlike `createOrReplaceTempView`. The alternative does not explain the same dependency.
Question 358
At Orion Fintech, while optimizing an ETL application (fictional study case R280-C072-1), a notebook rerun fails when attempting to register an already existing temporary view with `createTempView`. 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 Spark SQL catalog and reproduce the missing-table error before registration.
- Inspect `global_temp` catalog entries and both qualified and unqualified queries.
- Restart a test stream and compare state recovery with and without checkpoint configuration.
- Run the notebook twice and inspect registration errors and view contents.
Explanation
Correct Answer
D:Diagnose the affected path with: Run the notebook twice and inspect registration errors and view contents. This tests the case-specific cause: The registration method rejects duplicate names, unlike `createOrReplaceTempView`.
Incorrect Answers
A:Inspect Spark SQL catalog and reproduce the missing-table error before registration. The case requires a discriminating check before any change, not the offered alternative. Use: Run the notebook twice and inspect registration errors and view contents.
B:Inspect `global_temp` catalog entries and both qualified and unqualified queries. This is not the focused evidence-gathering step. Verify the suspected mechanism with: Run the notebook twice and inspect registration errors and view contents.
C:Restart a test stream and compare state recovery with and without checkpoint configuration. This is not the focused evidence-gathering step. Verify the suspected mechanism with: Run the notebook twice and inspect registration errors and view contents.
Question 359
At Westfield Insights, during an internal acceptance test (fictional study case R280-C072-2), a notebook rerun fails when attempting to register an already existing temporary view with `createTempView`. 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.
- SQL can query the intended DataFrame by the declared view name.
- The shared global temp view resolves correctly while still remaining application-scoped.
- Subsequent executions use the new DataFrame data without duplicate-name failure.
- Processing resumes from recovered offsets/state while view recreation follows session rules.
Explanation
Correct Answer
C:Acceptance requires: Subsequent executions use the new DataFrame data without duplicate-name failure. That directly tests whether the mechanism was corrected: The registration method rejects duplicate names, unlike `createOrReplaceTempView`.
Incorrect Answers
A:SQL can query the intended DataFrame by the declared view name. The alternative cannot demonstrate that the issue has been corrected: A notebook rerun fails when attempting to register an already existing temporary view with `createTempView`. The required result is: Subsequent executions use the new DataFrame data without duplicate-name failure.
B:The shared global temp view resolves correctly while still remaining application-scoped. The alternative cannot demonstrate that the issue has been corrected: A notebook rerun fails when attempting to register an already existing temporary view with `createTempView`. The required result is: Subsequent executions use the new DataFrame data without duplicate-name failure.
D:Processing resumes from recovered offsets/state while view recreation follows session rules. Implementation or a check alone is not proof of success. The measurable end state is: Subsequent executions use the new DataFrame data without duplicate-name failure.
Question 360
At Mapleford Engineering, after a routine data refresh (fictional study case R280-C072-1), a notebook rerun fails when attempting to register an already existing temporary view with `createTempView`. 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.
- Register only the needed relation in the current session.
- Replace only the designated temporary view.
- Change SQL name qualification without claiming persistence across applications.
- Add checkpoint storage only for the streaming query.
Explanation
Correct Answer
B:Keep the intervention within this boundary: Replace only the designated temporary view. The reported failure mechanism is: The registration method rejects duplicate names, unlike `createOrReplaceTempView`.
Incorrect Answers
A:Register only the needed relation in the current session. This does not enforce the required scope: Replace only the designated temporary view. The specific failure is: The registration method rejects duplicate names, unlike `createOrReplaceTempView`.
C:Change SQL name qualification without claiming persistence across applications. It is not the bounded choice for the stated condition: A notebook rerun fails when attempting to register an already existing temporary view with `createTempView`. The permitted change must remain: Replace only the designated temporary view.
D:Add checkpoint storage only for the streaming query. This does not enforce the required scope: Replace only the designated temporary view. The specific failure is: The registration method rejects duplicate names, unlike `createOrReplaceTempView`.