Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Intermediate step - Started adding predicates to varlength steps

  • Loading branch information...
commit ef1225a725b2e7ac78709a8f364ac39b1b6709a1 1 parent 00e17b2
Andres Taylor authored
3  cypher/src/main/scala/org/neo4j/cypher/internal/executionplan/builders/Trail.scala
View
@@ -125,6 +125,9 @@ final case class VariableLengthStepTrail(s: Trail,
path: String,
relIterator: Option[String],
end: String,
+ nodePredicate: Predicate,
+ pathPredicate: Predicate,
+ forEveryRelPredicate: Predicate,
pattern: Pattern) extends Trail {
def contains(target: String) = false
1  cypher/src/main/scala/org/neo4j/cypher/internal/pipes/matching/ExpanderStep.scala
View
@@ -29,7 +29,6 @@ trait ExpanderStep {
def typ: Seq[RelationshipType]
def direction: Direction
def id: Int
- def relPredicate: Predicate
def nodePredicate: Predicate
def createCopy(next:Option[ExpanderStep], direction:Direction, nodePredicate:Predicate):ExpanderStep
def size:Int
8 cypher/src/main/scala/org/neo4j/cypher/internal/pipes/matching/VarLengthStep.scala
View
@@ -42,8 +42,9 @@ case class VarLengthStep(id: Int,
min: Int,
max: Option[Int],
next: Option[ExpanderStep],
- relPredicate: Predicate,
- nodePredicate: Predicate) extends ExpanderStep {
+ nodePredicate: Predicate,
+ pathPredicate: Predicate,
+ forEveryRelPredicate: Predicate) extends ExpanderStep {
def createCopy(next: Option[ExpanderStep], direction: Direction, nodePredicate: Predicate): ExpanderStep =
copy(next = next, direction = direction, nodePredicate = nodePredicate)
@@ -139,8 +140,9 @@ case class VarLengthStep(id: Int,
val d = min == other.min
val e = max == other.max
val f = next == other.next
- val g = relPredicate == other.relPredicate
+ val g = pathPredicate == other.pathPredicate
val h = nodePredicate == other.nodePredicate
+ val i = forEveryRelPredicate== other.forEveryRelPredicate
a && b && c && d && e && f && g && h
case _ => false
}
4 cypher/src/test/scala/org/neo4j/cypher/internal/executionplan/builders/TrailToStepTest.scala
View
@@ -139,7 +139,9 @@ class TrailToStepTest extends GraphDatabaseTestBase with Assertions with Builder
val expected = varlengthStep(0, Seq(A), OUTGOING, 1, None, None)
val boundPoint = BoundPoint("e")
- val trail = VariableLengthStepTrail(boundPoint, Direction.OUTGOING, Seq("A"), 1, None, "p", None, "b", BtoE)
+ val trail = VariableLengthStepTrail(s = boundPoint, dir = Direction.OUTGOING, typ = Seq("A"), min = 1, max = None,
+ path = "p", relIterator = None, end = "b", nodePredicate = True(),
+ pathPredicate = True(), forEveryRelPredicate = True(), pattern = BtoE)
val result = trail.toSteps(0).get
assert(result.equals(expected))
Please sign in to comment.
Something went wrong with that request. Please try again.