BindParameters Logical Analysis Rule¶
BindParameters is a logical evaluation rule (Rule[LogicalPlan]).
BindParameters is part of Substitution fixed-point batch of rules.
Executing Rule¶
apply works on LogicalPlans with PARAMETERIZED_QUERY tree pattern only.
apply makes sure that there's exactly one ParameterizedQuery logical operator in the given LogicalPlan. Otherwise, apply throws an AssertionError:
apply resolves the following logical operators in the given LogicalPlan:
- NameParameterizedQuery
PosParameterizedQuery
apply checks the arguments and replaces the names (or the positions) with their corresponding Literals.
Binding¶
bind resolves expressions with PARAMETER tree pattern in the given LogicalPlan (incl. SubqueryExpressions) using the given f partial function.
Checking Arguments¶
Procedure
checkArgs is a procedure (returns Unit) so what happens inside stays inside (paraphrasing the former advertising slogan of Las Vegas, Nevada).
checkArgs makes sure that the Expressions in the given args collection are all Literals.
If not, checkArgs fails analysis with an AnalysisException: