Expand description
Module for planning SQL statements.
Planning phases:
- Resolve
- Bind
- Plan
§Resolving
First step in SQL planning. Walks the AST to resolve all tables and functions in the query. This retains the structure of the AST and annotates tables and functions with their catalog entries.
Resolving is async to allow for hitting remote resources (e.g. determining the schema of file, or contacting an external database).
This step also determines if we should be flipped to hybrid execution. When walking the AST, unknown references will be tracked. At the the end of resolving, we check for any unknown references, and if we have any, we send the statement a remote server. The remote side should complete resolving, and continue on with the remaining plan steps.
§Binding
Walk the AST and transform the query into something more amenable to planning.
During this phase, we build up a bind context which tracks “table-producing” steps within the query. This context is the basis for determining scoping within the query.
The bound statement produces is a halfway point between the AST and logical plan.
§Planning
Walks the bound statement and produces a logical plan.
Modules§
- binder
- logical_
aggregate - logical_
attach - logical_
copy - logical_
create - logical_
describe - logical_
discard - logical_
distinct - logical_
drop - logical_
explain - logical_
expression_ list - logical_
filter - logical_
inout - logical_
insert - logical_
join - logical_
limit - logical_
materialization - logical_
no_ rows - logical_
order - logical_
project - logical_
scan - logical_
set - logical_
setop - logical_
single_ row - logical_
unnest - logical_
window - operator
- planner
- Contains logic for converting raw SQL statement into a logical plan.
- resolver