A map from a TypeSymbol and a field on top of it to a new Symbol
The immutable state of the phase that can also be accessed by other phases.
The immutable state of the phase that can also be accessed by other phases.
Run the phase
Run the phase
Apply the replacements and current selection of a Comprehension to a new Node that will be merged into the Comprehension.
Lift a valid top-level or source Node into a subquery
Remove purely aliasing Bind
mappings, apply the conversion to the source, then inject the
mappings back into the source's mappings.
Merge the common operations Bind, Filter and CollectionCast into an existing Comprehension.
Merge the common operations Bind, Filter and CollectionCast into an existing Comprehension. This method is used at different stages of the pipeline. If the Comprehension already contains a Distinct clause, it is pushed into a subquery.
The unique name of the phase
The unique name of the phase
This phase merges nested nodes of types Bind, Filter, GroupBy, SortBy, Take, Drop, CollectionCast and Distinct to Comprehension nodes. Nodes can be merged if they occur in the following order:
[Source] -> Filter (where) -> GroupBy -> SortBy / (Distinct | Filter (having)) -> Take / Drop
Aliasing Binds and CollectionCasts are allowed everywhere in the chain. Any out of order operation starts a new chain with a subquery as the source.