Skip to content

Commit

Permalink
Rebasing conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusmelke committed Dec 6, 2017
1 parent c324fcd commit b3eedf4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
*/
package org.neo4j.cypher.internal.runtime.interpreted.commands.expressions

import org.neo4j.cypher.internal.runtime.{Expander, KernelPredicate}
import org.neo4j.cypher.internal.util.v3_4.{NonEmptyList, ShortestPathCommonEndNodesForbiddenException, SyntaxException}
import org.neo4j.kernel.impl.util.ValueUtils
import org.neo4j.cypher.internal.runtime.interpreted.ExecutionContext
import org.neo4j.cypher.internal.runtime.interpreted.commands.predicates._
import org.neo4j.cypher.internal.runtime.interpreted.commands.{Pattern, ShortestPath, SingleNode, _}
import org.neo4j.cypher.internal.runtime.interpreted.pipes.QueryState
import org.neo4j.cypher.internal.runtime.{Expander, KernelPredicate}
import org.neo4j.cypher.internal.util.v3_4.{NonEmptyList, ShortestPathCommonEndNodesForbiddenException, SyntaxException}
import org.neo4j.graphdb.{Path, PropertyContainer, Relationship}
import org.neo4j.kernel.impl.util.ValueUtils
import org.neo4j.values.AnyValue
import org.neo4j.values.storable.Values
import org.neo4j.values.virtual.{NodeReference, NodeValue, VirtualValues}
Expand Down Expand Up @@ -95,7 +95,7 @@ case class ShortestPathExpression(shortestPathPattern: ShortestPath, predicates:
throw new SyntaxException(
s"To find a shortest path, both ends of the path need to be provided. Couldn't find `$start`")) match {
case node: NodeValue => node
case node: NodeReference => ValueUtils.fromNodeProxy(state.query.nodeOps.getById(node.id()))
case node: NodeReference => state.query.nodeOps.getById(node.id())
}

private def anyStartpointsContainNull(m: Map[String, Any]): Boolean =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ package org.neo4j.cypher.internal.runtime.interpreted.pipes
import org.neo4j.cypher.internal.runtime.QueryContext
import org.neo4j.cypher.internal.runtime.interpreted.{ExecutionContext, ListSupport}
import org.neo4j.cypher.internal.v3_4.logical.plans.LogicalPlanId
import org.neo4j.kernel.impl.util.ValueUtils
import org.neo4j.values.virtual.VirtualValues.reverse
import org.neo4j.values.virtual.{EdgeReference, EdgeValue, ListValue, NodeValue}

Expand Down Expand Up @@ -73,7 +72,7 @@ case class ProjectEndpointsPipe(source: Pipe, relName: String,
private def findSimpleLengthRelEndpoints(context: ExecutionContext, qtx: QueryContext): Option[(NodeValue, NodeValue)] = {
val relValue = context(relName) match {
case edgeValue: EdgeValue => edgeValue
case edgeRef: EdgeReference => ValueUtils.fromRelationshipProxy(qtx.relationshipOps.getById(edgeRef.id()))
case edgeRef: EdgeReference => qtx.relationshipOps.getById(edgeRef.id())
}
val rel = Some(relValue).filter(hasAllowedType)
rel.flatMap { rel => pickStartAndEnd(rel, rel, context, qtx)}
Expand All @@ -84,11 +83,11 @@ case class ProjectEndpointsPipe(source: Pipe, relName: String,
if (rels.nonEmpty && allHasAllowedType(rels, qtx)) {
val firstRel = rels.head match {
case edgeValue: EdgeValue => edgeValue
case edgeRef: EdgeReference => ValueUtils.fromRelationshipProxy(qtx.relationshipOps.getById(edgeRef.id()))
case edgeRef: EdgeReference => qtx.relationshipOps.getById(edgeRef.id())
}
val lastRel = rels.last match {
case edgeValue: EdgeValue => edgeValue
case edgeRef: EdgeReference => ValueUtils.fromRelationshipProxy(qtx.relationshipOps.getById(edgeRef.id()))
case edgeRef: EdgeReference => qtx.relationshipOps.getById(edgeRef.id())
}
pickStartAndEnd(firstRel, lastRel, context, qtx).map { case (s, e) => (s, e, rels) }
} else {
Expand All @@ -101,7 +100,7 @@ case class ProjectEndpointsPipe(source: Pipe, relName: String,
while(iterator.hasNext) {
val next = iterator.next() match {
case edgeValue: EdgeValue => edgeValue
case edgeRef: EdgeReference => ValueUtils.fromRelationshipProxy(qtx.relationshipOps.getById(edgeRef.id()))
case edgeRef: EdgeReference => qtx.relationshipOps.getById(edgeRef.id())
}
if (!hasAllowedType(next)) return false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ case class PruningVarLengthExpandPipe(source: Pipe,
case Some(node: NodeValue) =>
nextState(row, node)
case Some(nodeRef: NodeReference) =>
val node = ValueUtils.fromNodeProxy(state.query.nodeOps.getById(nodeRef.id()))
val node = state.query.nodeOps.getById(nodeRef.id())
nextState(row, node)
case Some(x: Value) if x == Values.NO_VALUE =>
(Empty, null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import org.neo4j.cypher.internal.runtime.interpreted._
import org.neo4j.cypher.internal.runtime.interpreted.commands.expressions.Expression
import org.neo4j.cypher.internal.runtime.{Operations, QueryContext}
import org.neo4j.cypher.internal.util.v3_4.{CypherTypeException, InvalidArgumentException}
import org.neo4j.graphdb.{Node, PropertyContainer, Relationship}
import org.neo4j.values.AnyValue
import org.neo4j.values.storable.Values
import org.neo4j.values.virtual._
Expand Down Expand Up @@ -74,7 +73,7 @@ object SetOperation {

abstract class AbstractSetPropertyOperation extends SetOperation {

protected def setProperty[T <: PropertyContainer](context: ExecutionContext, state: QueryState, ops: Operations[T],
protected def setProperty[T](context: ExecutionContext, state: QueryState, ops: Operations[T],
itemId: Long, propertyKey: LazyPropertyKey,
expression: Expression) = {
val queryContext = state.query
Expand All @@ -91,7 +90,7 @@ abstract class AbstractSetPropertyOperation extends SetOperation {
}
}

abstract class SetEntityPropertyOperation[T <: PropertyContainer](itemName: String, propertyKey: LazyPropertyKey,
abstract class SetEntityPropertyOperation[T](itemName: String, propertyKey: LazyPropertyKey,
expression: Expression)
extends AbstractSetPropertyOperation {

Expand Down Expand Up @@ -161,10 +160,10 @@ case class SetPropertyOperation(entityExpr: Expression, propertyKey: LazyPropert
override def needsExclusiveLock = true
}

abstract class SetPropertyFromMapOperation[T <: PropertyContainer](itemName: String, expression: Expression,
abstract class SetPropertyFromMapOperation[T](itemName: String, expression: Expression,
removeOtherProps: Boolean) extends SetOperation {
override def set(executionContext: ExecutionContext, state: QueryState) = {
val item = executionContext.get(itemName).get
val item = executionContext(itemName)
if (item != Values.NO_VALUE) {
val ops = operations(state.query)
val itemId = id(item)
Expand Down

0 comments on commit b3eedf4

Please sign in to comment.