Skip to content

Commit

Permalink
Move interpreted runtime into it's own module
Browse files Browse the repository at this point in the history
This is a large refactoring with the main purpose of reducing
dependencies between the interpreted runtime and the rest of
cypher. In doing this two other modules had to be created:

  neo4j-runtime-util
    Holds common runtime classes and interfaces which are not
    tied to the interpreted or any other runtime

  neo4j-cypher-planner-spi-3.4
    Holds planner SPI interfaces. Some of these are also used by
    runtime classes, and this design limits the dependencies
    between planner and runtime implementations.

Not that non-versioned modules are free to depend on versioned modules,
but the reverse would break cypher versioning.

Following this refactoring, it should be possible to stop all
runtimes from depending of neo4j-cypher. That has not been attempted
here though.
  • Loading branch information
fickludd authored and systay committed Oct 30, 2017
1 parent 0d0f496 commit 068d213
Show file tree
Hide file tree
Showing 772 changed files with 5,077 additions and 2,775 deletions.
35 changes: 35 additions & 0 deletions community/cypher/cypher-compiler-3.4/LICENSES.txt
Expand Up @@ -4,6 +4,9 @@ libraries. For an overview of the licenses see the NOTICE.txt file.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
Apache Software License, Version 2.0 Apache Software License, Version 2.0
Caffeine cache Caffeine cache
Lucene Core
Lucene Memory
Netty/All-in-One
parboiled-core parboiled-core
parboiled-scala parboiled-scala
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
Expand Down Expand Up @@ -284,4 +287,36 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.




------------------------------------------------------------------------------
Bouncy Castle License
Bouncy Castle PKIX, CMS, EAC, TSP, PKCS, OCSP, CMP, and CRMF APIs
Bouncy Castle Provider
------------------------------------------------------------------------------

Please note: our license is an adaptation of the MIT X11 License and should be
read as such.

LICENSE

Copyright (c) 2000 - 2011 The Legion Of The Bouncy Castle
(http://www.bouncycastle.org)

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.




7 changes: 7 additions & 0 deletions community/cypher/cypher-compiler-3.4/NOTICE.txt
Expand Up @@ -27,6 +27,9 @@ Third-party licenses


Apache Software License, Version 2.0 Apache Software License, Version 2.0
Caffeine cache Caffeine cache
Lucene Core
Lucene Memory
Netty/All-in-One
parboiled-core parboiled-core
parboiled-scala parboiled-scala


Expand All @@ -36,3 +39,7 @@ BSD - Scala License
BSD License BSD License
Scala Compiler Scala Compiler


Bouncy Castle License
Bouncy Castle PKIX, CMS, EAC, TSP, PKCS, OCSP, CMP, and CRMF APIs
Bouncy Castle Provider

21 changes: 21 additions & 0 deletions community/cypher/cypher-compiler-3.4/pom.xml
Expand Up @@ -108,6 +108,11 @@
<artifactId>neo4j-cypher-logical-plans-3.4</artifactId> <artifactId>neo4j-cypher-logical-plans-3.4</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-cypher-planner-spi-3.4</artifactId>
<version>${project.version}</version>
</dependency>


<!-- neo4j testing --> <!-- neo4j testing -->


Expand All @@ -126,6 +131,14 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>


<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-cypher-expression-3.4</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency> <dependency>
<groupId>org.neo4j</groupId> <groupId>org.neo4j</groupId>
<artifactId>neo4j-cypher-frontend-3.4</artifactId> <artifactId>neo4j-cypher-frontend-3.4</artifactId>
Expand All @@ -134,6 +147,14 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>


<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-cypher-planner-spi-3.4</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency> <dependency>
<groupId>org.neo4j</groupId> <groupId>org.neo4j</groupId>
<artifactId>neo4j-io</artifactId> <artifactId>neo4j-io</artifactId>
Expand Down

This file was deleted.

Expand Up @@ -22,10 +22,9 @@ package org.neo4j.cypher.internal.compiler.v3_4
import java.time.Clock import java.time.Clock


import org.neo4j.cypher.internal.util.v3_4.InputPosition import org.neo4j.cypher.internal.util.v3_4.InputPosition
import org.neo4j.cypher.internal.compiler.v3_4.phases.CompilerContext import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.{ExpressionEvaluator, MetricsFactory, QueryGraphSolver}
import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.{ExpressionEvaluator, Metrics, MetricsFactory, QueryGraphSolver}
import org.neo4j.cypher.internal.compiler.v3_4.spi.PlanContext
import org.neo4j.cypher.internal.frontend.v3_4.phases.{BaseContext, CompilationPhaseTracer, InternalNotificationLogger, Monitors} import org.neo4j.cypher.internal.frontend.v3_4.phases.{BaseContext, CompilationPhaseTracer, InternalNotificationLogger, Monitors}
import org.neo4j.cypher.internal.planner.v3_4.spi.PlanContext


trait ContextCreator[Context <: BaseContext] { trait ContextCreator[Context <: BaseContext] {
def create(tracer: CompilationPhaseTracer, def create(tracer: CompilationPhaseTracer,
Expand Down
Expand Up @@ -30,6 +30,7 @@ import org.neo4j.cypher.internal.frontend.v3_4.ast.rewriters.ASTRewriter
import org.neo4j.cypher.internal.frontend.v3_4.helpers.rewriting.RewriterStepSequencer import org.neo4j.cypher.internal.frontend.v3_4.helpers.rewriting.RewriterStepSequencer
import org.neo4j.cypher.internal.frontend.v3_4.phases._ import org.neo4j.cypher.internal.frontend.v3_4.phases._
import org.neo4j.cypher.internal.ir.v3_4.UnionQuery import org.neo4j.cypher.internal.ir.v3_4.UnionQuery
import org.neo4j.cypher.internal.planner.v3_4.spi.{IDPPlannerName, PlannerNameFor}
import org.neo4j.cypher.internal.v3_4.logical.plans.LogicalPlan import org.neo4j.cypher.internal.v3_4.logical.plans.LogicalPlan


case class CypherCompiler[Context <: CompilerContext](astRewriter: ASTRewriter, case class CypherCompiler[Context <: CompilerContext](astRewriter: ASTRewriter,
Expand Down
Expand Up @@ -27,6 +27,7 @@ import org.neo4j.cypher.internal.frontend.v3_4.ast.rewriters.ASTRewriter
import org.neo4j.cypher.internal.frontend.v3_4.helpers.rewriting.RewriterStepSequencer import org.neo4j.cypher.internal.frontend.v3_4.helpers.rewriting.RewriterStepSequencer
import org.neo4j.cypher.internal.frontend.v3_4.phases.{Monitors, Transformer} import org.neo4j.cypher.internal.frontend.v3_4.phases.{Monitors, Transformer}
import org.neo4j.cypher.internal.frontend.v3_4.rewriters.IfNoParameter import org.neo4j.cypher.internal.frontend.v3_4.rewriters.IfNoParameter
import org.neo4j.cypher.internal.planner.v3_4.spi.CostBasedPlannerName


class CypherCompilerFactory[C <: CompilerContext, T <: Transformer[C, LogicalPlanState, LogicalPlanState]] { class CypherCompilerFactory[C <: CompilerContext, T <: Transformer[C, LogicalPlanState, LogicalPlanState]] {
val monitorTag = "cypher3.3" val monitorTag = "cypher3.3"
Expand Down
Expand Up @@ -21,9 +21,9 @@ package org.neo4j.cypher.internal.compiler.v3_4.ast.convert.plannerQuery


import org.neo4j.cypher.internal.compiler.v3_4.helpers.ListSupport import org.neo4j.cypher.internal.compiler.v3_4.helpers.ListSupport
import org.neo4j.cypher.internal.frontend.v3_4.ast.RelationshipStartItem import org.neo4j.cypher.internal.frontend.v3_4.ast.RelationshipStartItem
import org.neo4j.cypher.internal.frontend.v3_4.helpers.UnNamedNameGenerator
import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticTable import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticTable
import org.neo4j.cypher.internal.ir.v3_4._ import org.neo4j.cypher.internal.ir.v3_4._
import org.neo4j.cypher.internal.util.v3_4.UnNamedNameGenerator
import org.neo4j.cypher.internal.v3_4.expressions.SemanticDirection import org.neo4j.cypher.internal.v3_4.expressions.SemanticDirection


case class PlannerQueryBuilder(private val q: PlannerQuery, semanticTable: SemanticTable, returns: Seq[IdName] = Seq.empty) case class PlannerQueryBuilder(private val q: PlannerQuery, semanticTable: SemanticTable, returns: Seq[IdName] = Seq.empty)
Expand Down
Expand Up @@ -24,9 +24,9 @@ import java.time.Clock
import org.neo4j.cypher.internal.util.v3_4.{CypherException, InputPosition} import org.neo4j.cypher.internal.util.v3_4.{CypherException, InputPosition}
import org.neo4j.cypher.internal.compiler.v3_4._ import org.neo4j.cypher.internal.compiler.v3_4._
import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.{Metrics, QueryGraphSolver} import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.{Metrics, QueryGraphSolver}
import org.neo4j.cypher.internal.compiler.v3_4.spi.PlanContext
import org.neo4j.cypher.internal.frontend.v3_4.phases.{BaseContext, CompilationPhaseTracer, InternalNotificationLogger, Monitors} import org.neo4j.cypher.internal.frontend.v3_4.phases.{BaseContext, CompilationPhaseTracer, InternalNotificationLogger, Monitors}
import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticErrorDef import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticErrorDef
import org.neo4j.cypher.internal.planner.v3_4.spi.PlanContext


class CompilerContext(val exceptionCreator: (String, InputPosition) => CypherException, class CompilerContext(val exceptionCreator: (String, InputPosition) => CypherException,
val tracer: CompilationPhaseTracer, val tracer: CompilationPhaseTracer,
Expand Down
Expand Up @@ -20,13 +20,12 @@
package org.neo4j.cypher.internal.compiler.v3_4.phases package org.neo4j.cypher.internal.compiler.v3_4.phases


import org.neo4j.cypher.internal.util.v3_4.{Rewriter, bottomUp} import org.neo4j.cypher.internal.util.v3_4.{Rewriter, bottomUp}
import org.neo4j.cypher.internal.compiler.v3_4.ast.ResolvedFunctionInvocation
import org.neo4j.cypher.internal.compiler.v3_4.spi.PlanContext
import org.neo4j.cypher.internal.frontend.v3_4.ast._ import org.neo4j.cypher.internal.frontend.v3_4.ast._
import org.neo4j.cypher.internal.frontend.v3_4.ast.conditions.{StatementCondition, containsNoNodesOfType} import org.neo4j.cypher.internal.frontend.v3_4.ast.conditions.{StatementCondition, containsNoNodesOfType}
import org.neo4j.cypher.internal.frontend.v3_4.phases.CompilationPhaseTracer.CompilationPhase.AST_REWRITE import org.neo4j.cypher.internal.frontend.v3_4.phases.CompilationPhaseTracer.CompilationPhase.AST_REWRITE
import org.neo4j.cypher.internal.frontend.v3_4.phases.{BaseState, Condition, Phase} import org.neo4j.cypher.internal.frontend.v3_4.phases.{BaseState, Condition, Phase}
import org.neo4j.cypher.internal.v3_4.logical.plans.ResolvedCall import org.neo4j.cypher.internal.planner.v3_4.spi.PlanContext
import org.neo4j.cypher.internal.v3_4.logical.plans.{ResolvedCall, ResolvedFunctionInvocation}
import org.neo4j.cypher.internal.v3_4.expressions.FunctionInvocation import org.neo4j.cypher.internal.v3_4.expressions.FunctionInvocation


// Given a way to lookup procedure signatures, this phase rewrites unresolved calls into resolved calls // Given a way to lookup procedure signatures, this phase rewrites unresolved calls into resolved calls
Expand Down
Expand Up @@ -20,12 +20,12 @@
package org.neo4j.cypher.internal.compiler.v3_4.planner package org.neo4j.cypher.internal.compiler.v3_4.planner


import org.neo4j.cypher.internal.compiler.v3_4.phases._ import org.neo4j.cypher.internal.compiler.v3_4.phases._
import org.neo4j.cypher.internal.compiler.v3_4.spi.TokenContext
import org.neo4j.cypher.internal.frontend.v3_4.ast.Query import org.neo4j.cypher.internal.frontend.v3_4.ast.Query
import org.neo4j.cypher.internal.frontend.v3_4.phases.CompilationPhaseTracer.CompilationPhase.AST_REWRITE import org.neo4j.cypher.internal.frontend.v3_4.phases.CompilationPhaseTracer.CompilationPhase.AST_REWRITE
import org.neo4j.cypher.internal.frontend.v3_4.phases.{BaseState, VisitorPhase} import org.neo4j.cypher.internal.frontend.v3_4.phases.{BaseState, VisitorPhase}
import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticTable import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticTable
import org.neo4j.cypher.internal.frontend.v3_4.{LabelId, PropertyKeyId, RelTypeId} import org.neo4j.cypher.internal.planner.v3_4.spi.TokenContext
import org.neo4j.cypher.internal.util.v3_4.{LabelId, PropertyKeyId, RelTypeId}
import org.neo4j.cypher.internal.v3_4.expressions.{LabelName, PropertyKeyName, RelTypeName} import org.neo4j.cypher.internal.v3_4.expressions.{LabelName, PropertyKeyName, RelTypeName}


object ResolveTokens extends VisitorPhase[CompilerContext, BaseState] { object ResolveTokens extends VisitorPhase[CompilerContext, BaseState] {
Expand Down
Expand Up @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.compiler.v3_4.planner.logical


import org.neo4j.cypher.internal.compiler.v3_4.helpers.CachedFunction import org.neo4j.cypher.internal.compiler.v3_4.helpers.CachedFunction
import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.Metrics.{CardinalityModel, QueryGraphCardinalityModel} import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.Metrics.{CardinalityModel, QueryGraphCardinalityModel}
import org.neo4j.cypher.internal.compiler.v3_4.spi.GraphStatistics import org.neo4j.cypher.internal.planner.v3_4.spi.GraphStatistics


case class CachedMetricsFactory(metricsFactory: MetricsFactory) extends MetricsFactory { case class CachedMetricsFactory(metricsFactory: MetricsFactory) extends MetricsFactory {
def newCardinalityEstimator(queryGraphCardinalityModel: QueryGraphCardinalityModel, evaluator: ExpressionEvaluator): CardinalityModel = def newCardinalityEstimator(queryGraphCardinalityModel: QueryGraphCardinalityModel, evaluator: ExpressionEvaluator): CardinalityModel =
Expand Down
Expand Up @@ -22,6 +22,7 @@ package org.neo4j.cypher.internal.compiler.v3_4.planner.logical
import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.Metrics._ import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.Metrics._
import org.neo4j.cypher.internal.v3_4.logical.plans._ import org.neo4j.cypher.internal.v3_4.logical.plans._
import org.neo4j.cypher.internal.ir.v3_4._ import org.neo4j.cypher.internal.ir.v3_4._
import org.neo4j.cypher.internal.util.v3_4.{Cardinality, Cost, CostPerRow, Multiplier}
import org.neo4j.cypher.internal.v3_4.expressions.{HasLabels, Property} import org.neo4j.cypher.internal.v3_4.expressions.{HasLabels, Property}


object CardinalityCostModel extends CostModel { object CardinalityCostModel extends CostModel {
Expand Down
Expand Up @@ -22,10 +22,11 @@ package org.neo4j.cypher.internal.compiler.v3_4.planner.logical
import org.neo4j.csv.reader.Configuration.DEFAULT_LEGACY_STYLE_QUOTING import org.neo4j.csv.reader.Configuration.DEFAULT_LEGACY_STYLE_QUOTING
import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.Metrics.QueryGraphSolverInput import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.Metrics.QueryGraphSolverInput
import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.steps.LogicalPlanProducer import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.steps.LogicalPlanProducer
import org.neo4j.cypher.internal.compiler.v3_4.spi.PlanContext
import org.neo4j.cypher.internal.frontend.v3_4.phases.InternalNotificationLogger import org.neo4j.cypher.internal.frontend.v3_4.phases.InternalNotificationLogger
import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticTable import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticTable
import org.neo4j.cypher.internal.ir.v3_4.{Cardinality, IdName, StrictnessMode} import org.neo4j.cypher.internal.ir.v3_4.{IdName, StrictnessMode}
import org.neo4j.cypher.internal.planner.v3_4.spi.PlanContext
import org.neo4j.cypher.internal.util.v3_4.Cardinality
import org.neo4j.cypher.internal.v3_4.logical.plans.LogicalPlan import org.neo4j.cypher.internal.v3_4.logical.plans.LogicalPlan
import org.neo4j.cypher.internal.v3_4.expressions.Variable import org.neo4j.cypher.internal.v3_4.expressions.Variable


Expand Down
Expand Up @@ -20,9 +20,10 @@
package org.neo4j.cypher.internal.compiler.v3_4.planner.logical package org.neo4j.cypher.internal.compiler.v3_4.planner.logical


import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.Metrics.{CardinalityModel, CostModel, QueryGraphCardinalityModel} import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.Metrics.{CardinalityModel, CostModel, QueryGraphCardinalityModel}
import org.neo4j.cypher.internal.compiler.v3_4.spi.GraphStatistics
import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticTable import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticTable
import org.neo4j.cypher.internal.ir.v3_4.{PlannerQuery, _} import org.neo4j.cypher.internal.ir.v3_4.{PlannerQuery, _}
import org.neo4j.cypher.internal.planner.v3_4.spi.GraphStatistics
import org.neo4j.cypher.internal.util.v3_4.{Cardinality, Cost}
import org.neo4j.cypher.internal.v3_4.logical.plans.LogicalPlan import org.neo4j.cypher.internal.v3_4.logical.plans.LogicalPlan
import org.neo4j.cypher.internal.v3_4.expressions.{Expression, FunctionInvocation, LabelName, Parameter} import org.neo4j.cypher.internal.v3_4.expressions.{Expression, FunctionInvocation, LabelName, Parameter}
import org.neo4j.cypher.internal.v3_4.functions.{Rand, Timestamp} import org.neo4j.cypher.internal.v3_4.functions.{Rand, Timestamp}
Expand Down
Expand Up @@ -24,7 +24,8 @@ import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.Metrics.{CostMode
import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.steps.LogicalPlanProducer import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.steps.LogicalPlanProducer
import org.neo4j.cypher.internal.frontend.v3_4.phases.CompilationPhaseTracer.CompilationPhase.LOGICAL_PLANNING import org.neo4j.cypher.internal.frontend.v3_4.phases.CompilationPhaseTracer.CompilationPhase.LOGICAL_PLANNING
import org.neo4j.cypher.internal.frontend.v3_4.phases.Phase import org.neo4j.cypher.internal.frontend.v3_4.phases.Phase
import org.neo4j.cypher.internal.ir.v3_4.{Cost, PeriodicCommit, PlannerQuery, UnionQuery} import org.neo4j.cypher.internal.ir.v3_4.{PeriodicCommit, PlannerQuery, UnionQuery}
import org.neo4j.cypher.internal.util.v3_4.Cost
import org.neo4j.cypher.internal.v3_4.logical.plans.{LogicalPlan, ProduceResult} import org.neo4j.cypher.internal.v3_4.logical.plans.{LogicalPlan, ProduceResult}


case class QueryPlanner(planSingleQuery: LogicalPlanningFunction1[PlannerQuery, LogicalPlan] = PlanSingleQuery()) extends Phase[CompilerContext, LogicalPlanState, LogicalPlanState] { case class QueryPlanner(planSingleQuery: LogicalPlanningFunction1[PlannerQuery, LogicalPlan] = PlanSingleQuery()) extends Phase[CompilerContext, LogicalPlanState, LogicalPlanState] {
Expand Down
Expand Up @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.compiler.v3_4.planner.logical


import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.Metrics._ import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.Metrics._
import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.cardinality.QueryGraphCardinalityModel import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.cardinality.QueryGraphCardinalityModel
import org.neo4j.cypher.internal.compiler.v3_4.spi.GraphStatistics import org.neo4j.cypher.internal.planner.v3_4.spi.GraphStatistics


object SimpleMetricsFactory extends MetricsFactory { object SimpleMetricsFactory extends MetricsFactory {
def newCostModel(): CostModel = CardinalityCostModel def newCostModel(): CostModel = CardinalityCostModel
Expand Down
Expand Up @@ -22,9 +22,10 @@ package org.neo4j.cypher.internal.compiler.v3_4.planner.logical
import org.neo4j.cypher.internal.compiler.v3_4.helpers.MapSupport._ import org.neo4j.cypher.internal.compiler.v3_4.helpers.MapSupport._
import org.neo4j.cypher.internal.compiler.v3_4.planner._ import org.neo4j.cypher.internal.compiler.v3_4.planner._
import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.Metrics.{CardinalityModel, QueryGraphCardinalityModel, QueryGraphSolverInput} import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.Metrics.{CardinalityModel, QueryGraphCardinalityModel, QueryGraphSolverInput}
import org.neo4j.cypher.internal.compiler.v3_4.spi.GraphStatistics
import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticTable import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticTable
import org.neo4j.cypher.internal.ir.v3_4._ import org.neo4j.cypher.internal.ir.v3_4._
import org.neo4j.cypher.internal.planner.v3_4.spi.GraphStatistics
import org.neo4j.cypher.internal.util.v3_4.{Cardinality, Multiplier, Selectivity}
import org.neo4j.cypher.internal.v3_4.expressions.IntegerLiteral import org.neo4j.cypher.internal.v3_4.expressions.IntegerLiteral
import org.neo4j.values.storable.NumberValue import org.neo4j.values.storable.NumberValue


Expand Down
Expand Up @@ -23,13 +23,13 @@ import java.math
import java.math.RoundingMode import java.math.RoundingMode


import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.plans._ import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.plans._
import org.neo4j.cypher.internal.compiler.v3_4.spi.GraphStatistics
import org.neo4j.cypher.internal.compiler.v3_4.spi.GraphStatistics._
import org.neo4j.cypher.internal.compiler.v3_4.{IndexDescriptor, PrefixRange}
import org.neo4j.cypher.internal.frontend.v3_4.LabelId
import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticTable import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticTable
import org.neo4j.cypher.internal.ir.v3_4.{Cardinality, IdName, Selections, Selectivity} import org.neo4j.cypher.internal.ir.v3_4.{IdName, Selections}
import org.neo4j.cypher.internal.planner.v3_4.spi.{GraphStatistics, IndexDescriptor}
import org.neo4j.cypher.internal.planner.v3_4.spi.GraphStatistics._
import org.neo4j.cypher.internal.util.v3_4.{Cardinality, LabelId, Selectivity}
import org.neo4j.cypher.internal.v3_4.expressions._ import org.neo4j.cypher.internal.v3_4.expressions._
import org.neo4j.cypher.internal.v3_4.logical.plans.PrefixRange


trait Expression2Selectivity { trait Expression2Selectivity {
def apply(exp: Expression)(implicit semanticTable: SemanticTable, selections: Selections): Selectivity def apply(exp: Expression)(implicit semanticTable: SemanticTable, selections: Selections): Selectivity
Expand Down
Expand Up @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.compiler.v3_4.planner.logical.cardinality


import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.Metrics.QueryGraphCardinalityModel import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.Metrics.QueryGraphCardinalityModel
import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.cardinality.assumeIndependence.AssumeIndependenceQueryGraphCardinalityModel import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.cardinality.assumeIndependence.AssumeIndependenceQueryGraphCardinalityModel
import org.neo4j.cypher.internal.compiler.v3_4.spi.GraphStatistics import org.neo4j.cypher.internal.planner.v3_4.spi.GraphStatistics


object QueryGraphCardinalityModel { object QueryGraphCardinalityModel {
def default(statistics: GraphStatistics): QueryGraphCardinalityModel = def default(statistics: GraphStatistics): QueryGraphCardinalityModel =
Expand Down
Expand Up @@ -21,7 +21,7 @@ package org.neo4j.cypher.internal.compiler.v3_4.planner.logical.cardinality


import java.math import java.math


import org.neo4j.cypher.internal.ir.v3_4.Selectivity import org.neo4j.cypher.internal.util.v3_4.Selectivity


trait SelectivityCombiner { trait SelectivityCombiner {


Expand Down
Expand Up @@ -19,10 +19,11 @@
*/ */
package org.neo4j.cypher.internal.compiler.v3_4.planner.logical.cardinality package org.neo4j.cypher.internal.compiler.v3_4.planner.logical.cardinality


import org.neo4j.cypher.internal.compiler.v3_4.spi.GraphStatistics
import org.neo4j.cypher.internal.v3_4.expressions.Expression import org.neo4j.cypher.internal.v3_4.expressions.Expression
import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticTable import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticTable
import org.neo4j.cypher.internal.ir.v3_4.{Selections, Selectivity} import org.neo4j.cypher.internal.ir.v3_4.Selections
import org.neo4j.cypher.internal.planner.v3_4.spi.GraphStatistics
import org.neo4j.cypher.internal.util.v3_4.Selectivity


trait SelectivityEstimator extends (Expression => Selectivity) { trait SelectivityEstimator extends (Expression => Selectivity) {
self: SelectivityEstimator => self: SelectivityEstimator =>
Expand Down
Expand Up @@ -19,7 +19,7 @@
*/ */
package org.neo4j.cypher.internal.compiler.v3_4.planner.logical.cardinality package org.neo4j.cypher.internal.compiler.v3_4.planner.logical.cardinality


import org.neo4j.cypher.internal.util.v3_4.InternalException import org.neo4j.cypher.internal.util.v3_4.{InternalException, LabelId, NameId, RelTypeId}
import org.neo4j.cypher.internal.frontend.v3_4._ import org.neo4j.cypher.internal.frontend.v3_4._
import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticTable import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticTable
import org.neo4j.cypher.internal.ir.v3_4.IdName import org.neo4j.cypher.internal.ir.v3_4.IdName
Expand Down
Expand Up @@ -21,9 +21,10 @@ package org.neo4j.cypher.internal.compiler.v3_4.planner.logical.cardinality.assu


import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.Metrics.{QueryGraphCardinalityModel, QueryGraphSolverInput} import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.Metrics.{QueryGraphCardinalityModel, QueryGraphSolverInput}
import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.cardinality.{ExpressionSelectivityCalculator, SelectivityCombiner} import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.cardinality.{ExpressionSelectivityCalculator, SelectivityCombiner}
import org.neo4j.cypher.internal.compiler.v3_4.spi.GraphStatistics
import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticTable import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticTable
import org.neo4j.cypher.internal.ir.v3_4.{QueryGraph, _} import org.neo4j.cypher.internal.ir.v3_4.{QueryGraph, _}
import org.neo4j.cypher.internal.planner.v3_4.spi.GraphStatistics
import org.neo4j.cypher.internal.util.v3_4.{Cardinality, Selectivity}
import org.neo4j.cypher.internal.v3_4.expressions.LabelName import org.neo4j.cypher.internal.v3_4.expressions.LabelName


case class AssumeIndependenceQueryGraphCardinalityModel(stats: GraphStatistics, combiner: SelectivityCombiner) case class AssumeIndependenceQueryGraphCardinalityModel(stats: GraphStatistics, combiner: SelectivityCombiner)
Expand Down
Expand Up @@ -20,10 +20,10 @@
package org.neo4j.cypher.internal.compiler.v3_4.planner.logical.cardinality.assumeIndependence package org.neo4j.cypher.internal.compiler.v3_4.planner.logical.cardinality.assumeIndependence


import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.cardinality._ import org.neo4j.cypher.internal.compiler.v3_4.planner.logical.cardinality._
import org.neo4j.cypher.internal.compiler.v3_4.spi.GraphStatistics
import org.neo4j.cypher.internal.frontend.v3_4._
import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticTable import org.neo4j.cypher.internal.frontend.v3_4.semantics.SemanticTable
import org.neo4j.cypher.internal.ir.v3_4.{Selections, _} import org.neo4j.cypher.internal.ir.v3_4.{Selections, _}
import org.neo4j.cypher.internal.planner.v3_4.spi.GraphStatistics
import org.neo4j.cypher.internal.util.v3_4.{Cardinality, LabelId, RelTypeId, Selectivity}
import org.neo4j.cypher.internal.v3_4.expressions.{LabelName, RelTypeName, SemanticDirection} import org.neo4j.cypher.internal.v3_4.expressions.{LabelName, RelTypeName, SemanticDirection}


trait Pattern2Selectivity { trait Pattern2Selectivity {
Expand Down

0 comments on commit 068d213

Please sign in to comment.