resolveParams

internal fun resolveParams(raw: Map<String, Any?>, results: Map<StepHandle<*>, Any?>, stepIndex: Int, stepIndices: Map<StepHandle<*>, Int>): Map<String, Any?>

Replaces the unresolved values in a step's parameters with what the earlier steps produced.

A SpreadParameters contributes its entries under their own names instead of taking the name it was filed under, so the parameter map that comes out can be longer than the one that went in.

Everything that can fail here says which step it was resolving. A plan built in a loop has the same SQL and the same parameter names in every one of its steps, so the parameter alone does not identify anything and the query context on the exception cannot separate the third iteration from the seventeenth.

Parameters

raw

The step's parameters as they were written.

results

What the steps before this one produced.

stepIndex

Where this step sits in the plan being run.

stepIndices

Where every step sits, for naming the step a value was taken from.