Check Your Knowledge
Test your understanding of this section’s procedure-autopsy concepts before moving on.
- Why is a stored procedure a fundamentally different migration problem than a table?
- A. Procedures are always shorter than table definitions
- B. A procedure is a stateful process that executes in sequence and can branch, not a single declarative statement
- C. Procedures never contain any SQL
- D. Tables require more testing than procedures do
- Which of the following does NOT have a direct one-to-one equivalent in Spark SQL?
- A. A
SELECTstatement with aWHEREclause - B. An explicit cursor that fetches and processes rows one at a time
- C. A
JOINbetween two tables - D. A
GROUP BYaggregation
- A. A
- In the Autopsy method’s color scheme, what does a yellow block represent?
- A. Pure set-based SQL
- B. A transaction boundary (
COMMIT/ROLLBACK/SAVEPOINT) - C. A session-scoped temp table
- D. Procedural control flow like
IF/ELSE
- What does a color-coded pass reveal that a plain read of the procedure doesn’t?
- A. The exact runtime of the procedure in production
- B. How much of the procedure is genuinely set-based (blue) versus procedural scaffolding
- C. The original author’s name
- D. Whether the procedure has ever thrown an error
- According to “Only the Business Logic Migrates,” which block color is described as almost always business logic?
- A. Yellow
- B. Orange
- C. Blue
- D. Green
- Why are green (cursor loop) blocks usually discarded rather than translated literally?
- A. Because cursors are illegal in Delta Lake
- B. Because the loop construct itself encodes no business rule – only the statement inside it does
- C. Because Spark cannot execute any loop-like logic
- D. Because cursors always contain syntax errors
- What makes a cascading-trigger package harder to autopsy than a single stored procedure?
- A. Triggers cannot contain any SQL statements
- B. The execution order is implicit, scattered across separate trigger definitions, and has to be reconstructed as a graph
- C. Triggers are always written in a different language than procedures
- D. Databricks does not allow reading trigger source code
- In the trigger-graph mapping approach, what does a topological sort of the graph produce?
- A. A list of every column referenced in any trigger
- B. The true execution order the cascading triggers implied
- C. A count of how many triggers exist in the schema
- D. The original CREATE TRIGGER timestamps
- On the decomposition worksheet, why is “target pattern” always the last column filled in?
- A. It’s the least important column
- B. Committing to a target pattern before classification is finished risks reworking code once a later block doesn’t fit the chosen shape
- C. Target patterns can only be assigned by a database administrator
- D. The worksheet template requires columns to be filled alphabetically
- What is the decomposition worksheet’s role in the migration process?
- A. A one-time compliance form with no further use
- B. A per-procedure handoff document connecting the autopsy’s classification work to the actual translation work in the next section
- C. A replacement for reading the original PL/SQL entirely
- D. A performance benchmarking report
Answer Key
- B – A procedure executes statements in sequence, holds state, and branches – properties a single declarative SQL statement doesn’t have.
- B – Explicit row-at-a-time cursors have no direct equivalent in Spark’s set-based, distributed execution model.
- B – Yellow marks transaction boundaries like
COMMIT,ROLLBACK, andSAVEPOINT. - B – The color pass produces a visual map of how much of the procedure is genuinely set-based SQL versus procedural mechanism.
- C – Blue blocks (pure set-based SQL) are almost always the actual business rules worth preserving.
- B – The loop mechanism itself is procedural plumbing; only the condition and action inside the loop body carry business meaning.
- B – Trigger execution order is an emergent property of separate
CREATE TRIGGERdefinitions, discoverable only by reconstructing the dependency graph. - B – A topological sort of the trigger dependency graph produces the true execution order the cascade implied.
- B – Filling in target pattern last ensures classification is complete before any translation commitment is made, avoiding rework.
- B – The worksheet is the per-procedure artifact that carries the autopsy’s findings forward into the Pattern Translation section’s actual code.
| ← Previous: The Decomposition Worksheet | Next: Pattern Translation: Cursors, Triggers, Temp Tables, MERGE → | |:—|—:|