Hi,
I receive the above error under very certain conditions and I am not sure why this is the cause as when I try to recreate it in local db it doesnt happen (using neo4j 4.0.6 community).
I am using neo4j 4.0.0 Enterprise edition.
I have created nodes using the query below, repeated 4 times for each label.
CREATE (:Node1 {_uuid:'tester1'})
I then created index for each of the uuid using the query below
CREATE INDEX FOR (n:Node1)
ON (n._uuid)
I then run the query below
PROFILE UNWIND [{_uuid:'tester1', name:'skdjaf'}] AS props
UNWIND [{node2_uuid:'tester1', node3_uuid:'tester1'}] AS fields
MATCH (n:Node1 {_uuid:props._uuid})
SET n = props
WITH n, fields
OPTIONAL MATCH (a:Node2)
WHERE a._uuid = fields.node2_uuid
FOREACH (ignoreMe IN CASE WHEN a IS NULL THEN [] ELSE [1] END | MERGE (a)-[:WITH_2]->(n))
WITH n, fields
OPTIONAL MATCH (b:Node3)
WHERE b._uuid = fields.node3_uuid
FOREACH(ignoreMe IN CASE WHEN b IS NULL THEN [] ELSE [1] END | MERGE (b)-[:WITH_3]->(n))
WITH n, fields
OPTIONAL MATCH (c:Node4)
WHERE c._uuid = fields.node4_uuid
FOREACH (ignoreMe IN CASE WHEN c IS NULL THEN [] ELSE [1] END | MERGE (c)-[:INTER_4]->(d:Date)-[:WITH_4]->(n)
ON CREATE SET d.start_ts=datetime())
WITH n, fields
OPTIONAL MATCH (:Node2)-[r:WITH_2]->(n)
WHERE NOT EXISTS ((:Node2 {_uuid:fields.node2_uuid})-[:WITH_2]->(n))
DELETE r
WITH n, fields
OPTIONAL MATCH (:Node3)-[o:WITH_3]->(n)
WHERE NOT EXISTS ((:Node3 {_uuid:fields.node3_uuid})-[:WITH_3]->(n))
DELETE o
WITH n, fields
OPTIONAL MATCH (:Node4)-[:INTER_4]->(d:Date)-[z:ON]->(n)
WHERE NOT EXISTS(d.end_ts) AND NOT EXISTS ((:Node4 {_uuid:fields.node4_uuid})-[:INTER_4]->(:Date)-[:ON]->(d))
SET d.end_ts=datetime()
DELETE z
RETURN n AS data
I receive this error when I execute the query.
Expected
RegularSinglePlannerQuery(QueryGraph {},InterestingOrder(RequiredOrderCandidate(List()),List()),UnwindProjection(props,ListLiteral(List(MapExpression(List((PropertyKeyName(_uuid),Parameter( AUTOSTRING0,String)), (PropertyKeyName(name),Parameter( AUTOSTRING1,String))))))),Some(RegularSinglePlannerQuery(QueryGraph {Arguments: ['props']},InterestingOrder(RequiredOrderCandidate(List()),List()),UnwindProjection(fields,ListLiteral(List(MapExpression(List((PropertyKeyName(node2_uuid),Parameter( AUTOSTRING2,String)), (PropertyKeyName(node3_uuid),Parameter( AUTOSTRING3,String))))))),Some(RegularSinglePlannerQuery(QueryGraph {Nodes: ['n'], Arguments: ['fields', 'props'], Predicates: ['n:Node1', 'n._uuid = props._uuid']},InterestingOrder(RequiredOrderCandidate(List()),List()),RegularQueryProjection(Map(n -> Variable(n), fields -> Variable(fields)),QueryPagination(None,None),Selections(Set())),Some(RegularSinglePlannerQuery(QueryGraph {Arguments: ['fields', 'n'], Optional Matches: : ['QueryGraph {Nodes: ['a'], Arguments: ['fields'], Predicates: ['a._uuid = fields.node2_uuid', 'a:Node2']}']},InterestingOrder(RequiredOrderCandidate(List()),List()),PassthroughAllHorizon(),Some(RegularSinglePlannerQuery(QueryGraph {Arguments: ['a', 'fields', 'n']},InterestingOrder(RequiredOrderCandidate(List()),List()),PassthroughAllHorizon(),Some(RegularSinglePlannerQuery(QueryGraph {Arguments: ['a', 'fields', 'n'], Optional Matches: : ['QueryGraph {Nodes: ['b'], Arguments: ['fields'], Predicates: ['b._uuid = fields.node3_uuid', 'b:Node3']}']},InterestingOrder(RequiredOrderCandidate(List()),List()),PassthroughAllHorizon(),Some(RegularSinglePlannerQuery(QueryGraph {Arguments: ['a', 'b', 'fields', 'n']},InterestingOrder(RequiredOrderCandidate(List()),List()),PassthroughAllHorizon(),Some(RegularSinglePlannerQuery(QueryGraph {Arguments: ['a', 'b', 'fields', 'n'], Optional Matches: : ['QueryGraph {Nodes: ['c'], Arguments: ['fields'], Predicates: ['c._uuid = fields.node4_uuid', 'c:Node4']}']},InterestingOrder(RequiredOrderCandidate(List()),List()),PassthroughAllHorizon(),Some(RegularSinglePlannerQuery(QueryGraph {Arguments: ['a', 'b', 'c', 'fields', 'n']},InterestingOrder(RequiredOrderCandidate(List()),List()),PassthroughAllHorizon(),Some(RegularSinglePlannerQuery(QueryGraph {Arguments: ['a', 'b', 'c', 'fields', 'n'], Optional Matches: : ['QueryGraph {Nodes: [' UNNAMED746', 'n'], Rels: ['( UNNAMED746)--[r:WITH_2]->-(n)'], Arguments: ['fields', 'n'], Predicates: ['not EXISTS((:Node2 {_uuid: fields.node2_uuid})-[:WITH_2]->(n))', '` UNNAMED746`:Node2']}']},InterestingOrder(RequiredOrderCandidate(List()),List()),RegularQueryProjection(Map(n -> Variable(n), fields -> Variable(fields)),QueryPagination(None,None),Selections(Set())),Some(RegularSinglePlannerQuery(QueryGraph {Arguments: ['fields', 'n'], Optional Matches: : ['QueryGraph {Nodes: [' UNNAMED879', 'n'], Rels: ['( UNNAMED879)--[o:WITH_3]->-(n)'], Arguments: ['fields', 'n'], Predicates: ['not EXISTS((:Node3 {_uuid: fields.node3_uuid})-[:WITH_3]->(n))', '` UNNAMED879`:Node3']}']},InterestingOrder(RequiredOrderCandidate(List()),List()),RegularQueryProjection(Map(n -> Variable(n), fields -> Variable(fields)),QueryPagination(None,None),Selections(Set())),Some(RegularSinglePlannerQuery(QueryGraph {Arguments: ['fields', 'n'], Optional Matches: : ['QueryGraph {Nodes: [' UNNAMED1012', ' d@1033', 'n'], Rels: ['( UNNAMED1012)--[ UNNAMED1020:INTER_4]->-( d@1033)', '( d@1033)--[z:ON]->-(n)'], Arguments: ['fields', 'n'], Predicates: ['not EXISTS((:Node4 {_uuid: fields.node4_uuid})-[:INTER_4]->(:Date)-[:ON]->(` d@1033`))', 'not EXISTS(` d@1033`.end_ts)', '` d@1033`:Date', '` UNNAMED1012`:Node4']}']},InterestingOrder(RequiredOrderCandidate(List()),List()),RegularQueryProjection(Map(data -> Variable(n)),QueryPagination(None,None),Selections(Set())),None,None)),None)),None)),None)),None)),None)),None)),None)),None)),None)),None)),None)
Instead, got:
RegularSinglePlannerQuery(QueryGraph {},InterestingOrder(RequiredOrderCandidate(List()),List()),UnwindProjection(props,ListLiteral(List(MapExpression(List((PropertyKeyName(_uuid),Parameter( AUTOSTRING0,String)), (PropertyKeyName(name),Parameter( AUTOSTRING1,String))))))),Some(RegularSinglePlannerQuery(QueryGraph {Arguments: ['props']},InterestingOrder(RequiredOrderCandidate(List()),List()),UnwindProjection(fields,ListLiteral(List(MapExpression(List((PropertyKeyName(node2_uuid),Parameter( AUTOSTRING2,String)), (PropertyKeyName(node3_uuid),Parameter( AUTOSTRING3,String))))))),Some(RegularSinglePlannerQuery(QueryGraph {Nodes: ['n'], Arguments: ['fields', 'props'], Predicates: ['n._uuid = props._uuid', 'n:Node1']},InterestingOrder(RequiredOrderCandidate(List()),List()),RegularQueryProjection(Map(n -> Variable(n), fields -> Variable(fields)),QueryPagination(None,None),Selections(Set())),Some(RegularSinglePlannerQuery(QueryGraph {Arguments: ['fields', 'n'], Optional Matches: : ['QueryGraph {Nodes: ['a'], Arguments: ['fields'], Predicates: ['a._uuid = fields.node2_uuid', 'a:Node2']}']},InterestingOrder(RequiredOrderCandidate(List()),List()),PassthroughAllHorizon(),Some(RegularSinglePlannerQuery(QueryGraph {Arguments: ['a', 'fields', 'n']},InterestingOrder(RequiredOrderCandidate(List()),List()),PassthroughAllHorizon(),Some(RegularSinglePlannerQuery(QueryGraph {Arguments: ['a', 'fields', 'n'], Optional Matches: : ['QueryGraph {Nodes: ['b'], Arguments: ['fields'], Predicates: ['b._uuid = fields.node3_uuid', 'b:Node3']}']},InterestingOrder(RequiredOrderCandidate(List()),List()),PassthroughAllHorizon(),Some(RegularSinglePlannerQuery(QueryGraph {Arguments: ['a', 'b', 'fields', 'n']},InterestingOrder(RequiredOrderCandidate(List()),List()),PassthroughAllHorizon(),Some(RegularSinglePlannerQuery(QueryGraph {Arguments: ['a', 'b', 'fields', 'n'], Optional Matches: : ['QueryGraph {Nodes: ['c'], Arguments: ['fields'], Predicates: ['c._uuid = fields.node4_uuid', 'c:Node4']}']},InterestingOrder(RequiredOrderCandidate(List()),List()),PassthroughAllHorizon(),Some(RegularSinglePlannerQuery(QueryGraph {Arguments: ['a', 'b', 'c', 'fields', 'n']},InterestingOrder(RequiredOrderCandidate(List()),List()),PassthroughAllHorizon(),Some(RegularSinglePlannerQuery(QueryGraph {Arguments: ['a', 'b', 'c', 'fields', 'n'], Optional Matches: : ['QueryGraph {Nodes: [' UNNAMED746', 'n'], Rels: ['( UNNAMED746)--[r:WITH_2]->-(n)'], Arguments: ['n'], Predicates: ['` UNNAMED746`:Node2']}']},InterestingOrder(RequiredOrderCandidate(List()),List()),RegularQueryProjection(Map(n -> Variable(n), fields -> Variable(fields)),QueryPagination(None,None),Selections(Set())),Some(RegularSinglePlannerQuery(QueryGraph {Arguments: ['fields', 'n'], Optional Matches: : ['QueryGraph {Nodes: [' UNNAMED879', 'n'], Rels: ['( UNNAMED879)--[o:WITH_3]->-(n)'], Arguments: ['n'], Predicates: ['` UNNAMED879`:Node3']}']},InterestingOrder(RequiredOrderCandidate(List()),List()),RegularQueryProjection(Map(n -> Variable(n), fields -> Variable(fields)),QueryPagination(None,None),Selections(Set())),Some(RegularSinglePlannerQuery(QueryGraph {Arguments: ['fields', 'n'], Optional Matches: : ['QueryGraph {Nodes: [' UNNAMED1012', ' d@1033', 'n'], Rels: ['( UNNAMED1012)--[ UNNAMED1020:INTER_4]->-( d@1033)', '( d@1033)--[z:ON]->-(n)'], Arguments: ['fields', 'n'], Predicates: ['not EXISTS((:Node4 {_uuid: fields.node4_uuid})-[:INTER_4]->(:Date)-[:ON]->(` d@1033`))', 'not EXISTS(` d@1033`.end_ts)', '` d@1033`:Date', '` UNNAMED1012`:Node4']}']},InterestingOrder(RequiredOrderCandidate(List()),List()),RegularQueryProjection(Map(data -> Variable(n)),QueryPagination(None,None),Selections(Set())),None,None)),None)),None)),None)),None)),None)),None)),None)),None)),None)),None)),None)
Plan: ProduceResult(List(data)) {
LHS -> Projection(Map(data -> Variable(n))) {
LHS -> DeleteRelationship(Variable(z)) {
LHS -> SetNodeProperty( d@1033, PropertyKeyName(end_ts), ResolvedFunctionInvocation(datetime,Some(datetime(input = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: DATETIME?),Vector())) {
LHS -> Eager() {
LHS -> Apply() {
LHS -> Eager() {
LHS -> DeleteRelationship(Variable(o)) {
LHS -> Eager() {
LHS -> Apply() {
LHS -> Eager() {
LHS -> DeleteRelationship(Variable(r)) {
LHS -> Eager() {
LHS -> Apply() {
LHS -> Eager() {
LHS -> Eager() {
LHS -> Apply() {
LHS -> Eager() {
LHS -> Apply() {
LHS -> Eager() {
LHS -> Eager() {
LHS -> Apply() {
LHS -> Eager() {
LHS -> Apply() {
LHS -> Eager() {
LHS -> Eager() {
LHS -> Apply() {
LHS -> Eager() {
LHS -> Apply() {
LHS -> Eager() {
LHS -> Eager() {
LHS -> SetNodePropertiesFromMap(n, Variable(props), true) {
LHS -> Eager() {
LHS -> Apply() {
LHS -> UnwindCollection(fields, ListLiteral(List(MapExpression(List((PropertyKeyName(node2_uuid),Parameter( AUTOSTRING2,String)), (PropertyKeyName(node3_uuid),Parameter( AUTOSTRING3,String))))))) {
LHS -> Apply() {
LHS -> UnwindCollection(props, ListLiteral(List(MapExpression(List((PropertyKeyName(_uuid),Parameter( AUTOSTRING0,String)), (PropertyKeyName(name),Parameter( AUTOSTRING1,String))))))) {
LHS -> Argument(Set()) {}
}
RHS -> Argument(Set(props)) {}
}
}
RHS -> NodeIndexSeek(n, LabelToken(Node1,LabelId(17)), List(IndexedProperty(PropertyKeyToken(_uuid,PropertyKeyId(0)),CanGetValue)), SingleQueryExpression(Property(Variable(props),PropertyKeyName(_uuid))), Set(props, fields), IndexOrderNone) {}
}
}
}
}
}
RHS -> Apply() {
LHS -> Argument(Set(n, fields)) {}
RHS -> Optional(Set(n, fields)) {
LHS -> NodeIndexSeek(a, LabelToken(Node2,LabelId(18)), List(IndexedProperty(PropertyKeyToken(_uuid,PropertyKeyId(0)),CanGetValue)), SingleQueryExpression(Property(Variable(fields),PropertyKeyName(node2_uuid))), Set(fields), IndexOrderNone) {}
}
}
}
}
RHS -> ForeachApply( ignoreMe@248, CaseExpression(None,Vector((IsNull(Variable(a)),ListLiteral(List()))),Some(ListLiteral(List(SignedDecimalIntegerLiteral(1)))))) {
LHS -> Argument(Set(n, fields, a)) {}
RHS -> AntiConditionalApply(Vector( UNNAMED314)) {
LHS -> AntiConditionalApply(Vector( UNNAMED314)) {
LHS -> Apply() {
LHS -> Argument(Set(n, fields, a, ignoreMe@248)) {}
RHS -> Optional(Set(a, n)) {
LHS -> Expand(a, OUTGOING, List(RelTypeName(WITH_2)), n, UNNAMED314, ExpandInto) {
LHS -> Argument(Set(a, n)) {}
}
}
}
RHS -> Optional(Set(a, n)) {
LHS -> Expand(a, OUTGOING, List(RelTypeName(WITH_2)), n, UNNAMED314, ExpandInto) {
LHS -> LockNodes(Set(a, n)) {
LHS -> Argument(Set(a, n)) {}
}
}
}
}
RHS -> MergeCreateRelationship( UNNAMED314, a, RelTypeName(WITH_2), n, None) {
LHS -> Argument(Set(a, n)) {}
}
}
}
}
}
}
RHS -> Apply() {
LHS -> Argument(Set(n, fields, a)) {}
RHS -> Optional(Set(n, fields, a)) {
LHS -> NodeIndexSeek(b, LabelToken(Node3,LabelId(19)), List(IndexedProperty(PropertyKeyToken(_uuid,PropertyKeyId(0)),CanGetValue)), SingleQueryExpression(Property(Variable(fields),PropertyKeyName(node3_uuid))), Set(fields), IndexOrderNone) {}
}
}
}
}
RHS -> ForeachApply( ignoreMe@412, CaseExpression(None,Vector((IsNull(Variable(b)),ListLiteral(List()))),Some(ListLiteral(List(SignedDecimalIntegerLiteral(1)))))) {
LHS -> Argument(Set(n, fields, a, b)) {}
RHS -> AntiConditionalApply(Vector( UNNAMED477)) {
LHS -> AntiConditionalApply(Vector( UNNAMED477)) {
LHS -> Apply() {
LHS -> Argument(Set( ignoreMe@412, n, a, b, fields)) {}
RHS -> Optional(Set(b, n)) {
LHS -> Expand(b, OUTGOING, List(RelTypeName(WITH_3)), n, UNNAMED477, ExpandInto) {
LHS -> Argument(Set(b, n)) {}
}
}
}
RHS -> Optional(Set(b, n)) {
LHS -> Expand(b, OUTGOING, List(RelTypeName(WITH_3)), n, UNNAMED477, ExpandInto) {
LHS -> LockNodes(Set(b, n)) {
LHS -> Argument(Set(b, n)) {}
}
}
}
}
RHS -> MergeCreateRelationship( UNNAMED477, b, RelTypeName(WITH_3), n, None) {
LHS -> Argument(Set(b, n)) {}
}
}
}
}
}
}
RHS -> Apply() {
LHS -> Argument(Set(n, fields, a, b)) {}
RHS -> Optional(Set(n, fields, a, b)) {
LHS -> NodeIndexSeek(c, LabelToken(Node4,LabelId(20)), List(IndexedProperty(PropertyKeyToken(_uuid,PropertyKeyId(0)),CanGetValue)), SingleQueryExpression(Property(Variable(fields),PropertyKeyName(node4_uuid))), Set(fields), IndexOrderNone) {}
}
}
}
}
RHS -> ForeachApply( ignoreMe@576, CaseExpression(None,Vector((IsNull(Variable(c)),ListLiteral(List()))),Some(ListLiteral(List(SignedDecimalIntegerLiteral(1)))))) {
LHS -> Argument(Set(n, a, b, fields, c)) {}
RHS -> AntiConditionalApply(Vector( d@655, UNNAMED642, UNNAMED663)) {
LHS -> AntiConditionalApply(Vector( d@655, UNNAMED642, UNNAMED663)) {
LHS -> Apply() {
LHS -> Argument(Set(n, a, ignoreMe@576, b, fields, c)) {}
RHS -> Optional(Set(n, c)) {
LHS -> Expand(c, OUTGOING, List(RelTypeName(INTER_4)), d@655, UNNAMED642, ExpandInto) {
LHS -> Selection(Ands(Set(HasLabels(Variable( d@655),List(LabelName(Date)))))) {
LHS -> Expand(n, INCOMING, List(RelTypeName(WITH_4)), d@655, UNNAMED663, ExpandAll) {
LHS -> Argument(Set(n, c)) {}
}
}
}
}
}
RHS -> Optional(Set(n, c)) {
LHS -> Expand(c, OUTGOING, List(RelTypeName(INTER_4)), d@655, UNNAMED642, ExpandInto) {
LHS -> Selection(Ands(Set(HasLabels(Variable( d@655),List(LabelName(Date)))))) {
LHS -> Expand(n, INCOMING, List(RelTypeName(WITH_4)), d@655, UNNAMED663, ExpandAll) {
LHS -> LockNodes(Set(c, n)) {
LHS -> Argument(Set(n, c)) {}
}
}
}
}
}
}
RHS -> SetNodeProperty( d@655, PropertyKeyName(start_ts), ResolvedFunctionInvocation(datetime,Some(datetime(input = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: DATETIME?),Vector())) {
LHS -> MergeCreateRelationship( UNNAMED663, d@655, RelTypeName(WITH_4), n, None) {
LHS -> MergeCreateRelationship( UNNAMED642, c, RelTypeName(INTER_4), d@655, None) {
LHS -> MergeCreateNode( d@655, List(LabelName(Date)), None) {
LHS -> Argument(Set(n, c)) {}
}
}
}
}
}
}
}
}
}
RHS -> RightOuterHashJoin(Set(n)) {
LHS -> Expand( UNNAMED746, OUTGOING, List(RelTypeName(WITH_2)), n, r, ExpandAll) {
LHS -> NodeByLabelScan( UNNAMED746, LabelName(Node2), Set()) {}
}
RHS -> Argument(Set(n, a, b, fields, c)) {}
}
}
}
}
}
RHS -> RightOuterHashJoin(Set(n)) {
LHS -> Expand( UNNAMED879, OUTGOING, List(RelTypeName(WITH_3)), n, o, ExpandAll) {
LHS -> NodeByLabelScan( UNNAMED879, LabelName(Node3), Set()) {}
}
RHS -> Argument(Set(n, fields)) {}
}
}
}
}
}
RHS -> Apply() {
LHS -> Argument(Set(n, fields)) {}
RHS -> Optional(Set(n, fields)) {
LHS -> Selection(Ands(Set(HasLabels(Variable( UNNAMED1012),List(LabelName(Node4)))))) {
LHS -> Expand( d@1033, INCOMING, List(RelTypeName(INTER_4)), UNNAMED1012, UNNAMED1020, ExpandAll) {
LHS -> Selection(Ands(Set(Not(FunctionInvocation(Namespace(List()),FunctionName(EXISTS),false,Vector(Property(Variable( d@1033),PropertyKeyName(end_ts))))), HasLabels(Variable( d@1033),List(LabelName(Date)))))) {
LHS -> AntiSemiApply() {
LHS -> Expand(n, INCOMING, List(RelTypeName(ON)), d@1033, z, ExpandAll) {
LHS -> Argument(Set(n, fields)) {}
}
RHS -> Selection(Ands(Set(Equals(Property(Variable( NODE1097),PropertyKeyName(_uuid)),Property(Variable(fields),PropertyKeyName(node4_uuid))), HasLabels(Variable( NODE1097),List(LabelName(Node4)))))) {
LHS -> Expand( NODE1144, INCOMING, List(RelTypeName(INTER_4)), NODE1097, REL1131, ExpandAll) {
LHS -> Selection(Ands(Set(HasLabels(Variable( NODE1144),List(LabelName(Date)))))) {
LHS -> Expand( d@1033, INCOMING, List(RelTypeName(ON)), NODE1144, REL1151, ExpandAll) {
LHS -> Argument(Set( d@1033, fields)) {}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
However the error is resolved when I remove the index for any 2 out of the 4 index I created.
The error is also resolved when I have all 4 index but I change the query slightly by deleting first then adding shown below.
PROFILE UNWIND [{_uuid:'tester1', name:'skdjaf'}] AS props
UNWIND [{node2_uuid:'tester1', node3_uuid:'tester1'}] AS fields
MATCH (n:Node1 {_uuid:props._uuid})
SET n = props
WITH n, fields
OPTIONAL MATCH (:Node2)-[r:WITH_2]->(n)
WHERE NOT EXISTS ((:Node2 {_uuid:fields.node2_uuid})-[:WITH_2]->(n))
DELETE r
WITH n, fields
OPTIONAL MATCH (:Node3)-[o:WITH_3]->(n)
WHERE NOT EXISTS ((:Node3 {_uuid:fields.node3_uuid})-[:WITH_3]->(n))
DELETE o
WITH n, fields
OPTIONAL MATCH (:Node4)-[:INTER_4]->(d:Date)-[z:ON]->(n)
WHERE NOT EXISTS(d.end_ts) AND NOT EXISTS ((:Node4 {_uuid:fields.node4_uuid})-[:INTER_4]->(:Date)-[:ON]->(d))
SET d.end_ts=datetime()
DELETE z
WITH n, fields
OPTIONAL MATCH (a:Node2)
WHERE a._uuid = fields.node2_uuid
FOREACH (ignoreMe IN CASE WHEN a IS NULL THEN [] ELSE [1] END | MERGE (a)-[:WITH_2]->(n))
WITH n, fields
OPTIONAL MATCH (b:Node3)
WHERE b._uuid = fields.node3_uuid
FOREACH(ignoreMe IN CASE WHEN b IS NULL THEN [] ELSE [1] END | MERGE (b)-[:WITH_3]->(n))
WITH n, fields
OPTIONAL MATCH (c:Node4)
WHERE c._uuid = fields.node4_uuid
FOREACH (ignoreMe IN CASE WHEN c IS NULL THEN [] ELSE [1] END | MERGE (c)-[:INTER_4]->(d:Date)-[:WITH_4]->(n)
ON CREATE SET d.start_ts=datetime())
RETURN n AS data
I really don't understand why this is happening only when I use this particular db version.