Package

org.opencypher.v9_0.rewriting

rewriters

Permalink

package rewriters

Visibility
  1. Public
  2. All

Type Members

  1. case class InliningContext(projections: Map[LogicalVariable, Expression] = Map.empty, seenVariables: Set[LogicalVariable] = Set.empty, usageCount: Map[LogicalVariable, Int] = Map.empty) extends Product with Serializable

    Permalink
  2. sealed trait LiteralExtraction extends AnyRef

    Permalink
  3. abstract class MatchPredicateNormalization extends Rewriter

    Permalink
  4. trait MatchPredicateNormalizer extends AnyRef

    Permalink
  5. case class MatchPredicateNormalizerChain(normalizers: MatchPredicateNormalizer*) extends MatchPredicateNormalizer with Product with Serializable

    Permalink
  6. case class ReturnItemSafeTopDownRewriter(inner: Rewriter) extends Rewriter with Product with Serializable

    Permalink
  7. case class deMorganRewriter()(implicit monitor: AstRewritingMonitor) extends Rewriter with Product with Serializable

    Permalink
  8. case class desugarMapProjection(state: SemanticState) extends Rewriter with Product with Serializable

    Permalink
  9. case class distributeLawsRewriter()(implicit monitor: AstRewritingMonitor) extends Rewriter with Product with Serializable

    Permalink
  10. case class expandStar(state: SemanticState) extends Rewriter with Product with Serializable

    Permalink
  11. case class normalizeMatchPredicates(getDegreeRewriting: Boolean) extends MatchPredicateNormalization with Product with Serializable

    Permalink
  12. case class normalizeReturnClauses(mkException: (String, InputPosition) ⇒ CypherException) extends Rewriter with Product with Serializable

    Permalink

    This rewriter makes sure that all return items in a RETURN clauses are aliased, and moves any ORDER BY to a preceding WITH clause

    This rewriter makes sure that all return items in a RETURN clauses are aliased, and moves any ORDER BY to a preceding WITH clause

    Example:

    MATCH (n) RETURN n.foo AS foo, n.bar ORDER BY foo

    This rewrite will change the query to:

    MATCH (n) WITH n.foo AS FRESHIDxx, n.bar AS FRESHIDnn ORDER BY FRESHIDxx RETURN FRESHIDxx AS foo, FRESHIDnn AS n.bar

  13. case class normalizeWithClauses(mkException: (String, InputPosition) ⇒ CypherException) extends Rewriter with Product with Serializable

    Permalink

    This rewriter normalizes the scoping structure of a query, ensuring it is able to be correctly processed for semantic checking.

    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.

  14. case class recordScopes(semanticState: SemanticState) extends Rewriter with Product with Serializable

    Permalink
  15. case class repeatWithSizeLimit(rewriter: Rewriter)(implicit monitor: AstRewritingMonitor) extends Rewriter with Product with Serializable

    Permalink

Value Members

  1. object CaseInsensitiveOrdered extends Ordering[String]

    Permalink
  2. object Forced extends LiteralExtraction with Product with Serializable

    Permalink
  3. object IfNoParameter extends LiteralExtraction with Product with Serializable

    Permalink
  4. object InliningContext extends Serializable

    Permalink
  5. object LabelPredicateNormalizer extends MatchPredicateNormalizer

    Permalink
  6. object Never extends LiteralExtraction with Product with Serializable

    Permalink
  7. object PatternExpressionPatternElementNamer

    Permalink
  8. object PropertyPredicateNormalizer extends MatchPredicateNormalizer

    Permalink
  9. object addUniquenessPredicates extends Rewriter with Product with Serializable

    Permalink
  10. object calculateUsingGetDegree

    Permalink
  11. object collapseMultipleInPredicates extends Rewriter with Product with Serializable

    Permalink
  12. object copyVariables extends Rewriter with Product with Serializable

    Permalink
  13. object distributeLawsRewriter extends Serializable

    Permalink
  14. object expandCallWhere extends Rewriter with Product with Serializable

    Permalink
  15. object flattenBooleanOperators extends Rewriter

    Permalink
  16. object foldConstants extends Rewriter with Product with Serializable

    Permalink
  17. object inlineNamedPathsInPatternComprehensions extends Rewriter with Product with Serializable

    Permalink
  18. object inlineProjections extends Rewriter with Product with Serializable

    Permalink
  19. object inliningContextCreator extends (Statement) ⇒ InliningContext

    Permalink
  20. object isolateAggregation extends Rewriter with Product with Serializable

    Permalink

    This rewriter makes sure that aggregations are on their own in RETURN/WITH clauses, so the planner can have an easy time

    This rewriter makes sure that aggregations are on their own in RETURN/WITH clauses, so the planner can have an easy time

    Example:

    MATCH (n) RETURN { name: n.name, count: count(*) }, n.foo

    This query has a RETURN clause where the single expression contains both the aggregate key and the aggregation expression. To make the job easier on the planner, this rewrite will change the query to:

    MATCH (n) WITH n.name AS x1, count(*) AS x2, n.foo as X3 RETURN { name: x1, count: x2 }

  21. object literalReplacement

    Permalink
  22. object mergeInPredicates extends Rewriter with Product with Serializable

    Permalink

    Merges multiple IN predicates into one.

    Merges multiple IN predicates into one.

    Examples: MATCH (n) WHERE n.prop IN [1,2,3] AND [2,3,4] RETURN n.prop

    > MATCH (n) WHERE n.prop IN [2,3]

    MATCH (n) WHERE n.prop IN [1,2,3] OR [2,3,4] RETURN n.prop

    > MATCH (n) WHERE n.prop IN [1,2,3,4]

    MATCH (n) WHERE n.prop IN [1,2,3] AND [4,5,6] RETURN n.prop

    > MATCH (n) WHERE FALSE

    NOTE: this rewriter must be applied before auto parameterization, since after that we are just dealing with opaque parameters.

  23. object nameAllPatternElements extends Rewriter with Product with Serializable

    Permalink
  24. object nameMatchPatternElements extends Rewriter with Product with Serializable

    Permalink
  25. object namePatternComprehensionPatternElements extends Rewriter with Product with Serializable

    Permalink
  26. object nameUpdatingClauses extends Rewriter with Product with Serializable

    Permalink
  27. object normalizeArgumentOrder extends Rewriter with Product with Serializable

    Permalink
  28. object normalizeComparisons extends Rewriter with Product with Serializable

    Permalink
  29. object normalizeNotEquals extends Rewriter with Product with Serializable

    Permalink
  30. object normalizeSargablePredicates extends Rewriter with Product with Serializable

    Permalink
  31. object projectFreshSortExpressions extends Rewriter with Product with Serializable

    Permalink

    This rewriter ensures that WITH clauses containing a ORDER BY or WHERE are split, such that the ORDER BY or WHERE does not refer to any newly introduced variable.

    This rewriter ensures that WITH clauses containing a ORDER BY or WHERE are split, such that the ORDER BY or WHERE does not refer to any newly introduced variable.

    This is required due to constraints in the planner. Note that this structure is invalid for semantic checking, which requires that ORDER BY and WHERE _only refer to variables introduced in the associated WITH_.

    Additionally, it splits RETURN clauses containing ORDER BY. This would typically be done earlier during normalizeReturnClauses, however "RETURN * ORDER BY" is not handled at that stage, due to lacking variable information. If expandStar has already been run, then this will now work as expected.

  32. object projectNamedPaths extends Rewriter with Product with Serializable

    Permalink
  33. object reattachAliasedExpressions extends Rewriter with Product with Serializable

    Permalink
  34. object replaceAliasedFunctionInvocations extends Rewriter with Product with Serializable

    Permalink
  35. object replaceLiteralDynamicPropertyLookups extends Rewriter with Product with Serializable

    Permalink
  36. object simplifyPredicates extends Rewriter

    Permalink

Ungrouped