Skip to main content

Module logical

Module logical 

Source
Expand description

Module for planning SQL statements.

Planning phases:

  1. Resolve
  2. Bind
  3. 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