case classnormalizeWithClauses(mkException: (String, InputPosition) ⇒ CypherException) extends Rewriter with Product with Serializable
This rewriter normalizes the scoping structure of a query, ensuring it is able to
be correctly processed for semantic checking. It makes sure that all return items
in a WITH clauses are aliased, and ensures all ORDER BY and WHERE expressions are
shifted into the clause, leaving only a variable. That variable must also
appear as an alias in the associated WITH.
This rewriter depends on normalizeReturnClauses having first been run.
Example:
MATCH n
WITH n.prop AS prop ORDER BY n.foo DESC
RETURN prop
This rewrite will change the query to:
MATCH n
WITH n AS n, n.prop AS prop
WITH prop AS prop, n.foo AS FRESHID39 ORDER BY FRESHID39 DESC
WITH prop AS prop
RETURN prop
It uses multiple WITH clauses to ensure that cardinality and grouping are not altered, even in the presence
of aggregation.
Linear Supertypes
Serializable, Serializable, Product, Equals, (AnyRef) ⇒ AnyRef, AnyRef, Any
This rewriter normalizes the scoping structure of a query, ensuring it is able to be correctly processed for semantic checking. It makes sure that all return items in a WITH clauses are aliased, and ensures all ORDER BY and WHERE expressions are shifted into the clause, leaving only a variable. That variable must also appear as an alias in the associated WITH.
This rewriter depends on normalizeReturnClauses having first been run.
Example:
MATCH n WITH n.prop AS prop ORDER BY n.foo DESC RETURN prop
This rewrite will change the query to:
MATCH n WITH n AS n, n.prop AS prop WITH prop AS prop, n.foo AS
FRESHID39ORDER BYFRESHID39DESC WITH prop AS prop RETURN propIt uses multiple WITH clauses to ensure that cardinality and grouping are not altered, even in the presence of aggregation.