Module canonicalization

Source
Expand description

Transformations that bring relation expressions to their canonical form.

This is achieved by:

  1. Bringing enclosed scalar expressions to a canonical form,
  2. Converting / peeling off part of the enclosing relation expression into another relation expression that can represent the same concept.

Modules§

flat_map_elimination 🔒
For a FlatMap where the table function’s arguments are all constants, turns it into Map if only 1 row is produced by the table function, or turns it into an empty constant collection if 0 rows are produced by the table function.
projection_extraction 🔒
Transform column references in a Map into a Project.
topk_elision 🔒
Remove TopK operators with both an offset of zero and no limit.

Structs§

FlatMapElimination
Attempts to eliminate FlatMaps that are sure to have 0 or 1 results on each input row.
ProjectionExtraction
Transform column references in a Map into a Project, or repeated aggregations in a Reduce into a Project.
ReduceScalars
A transform that visits each AST node and reduces scalar expressions.
TopKElision
Remove TopK operators with both an offset of zero and no limit.