Neo4j raises error when I try to remove a property from a node given by an expression.
CREATE (:Person {name: 'Alice', age: 23})-[:KNOWS]->(:Person {name:'Bob', age: 24})
MATCH (a:Person {name: 'Alice'})-[:KNOWS]->(b:Person {name: 'Bob'})
REMOVE CASE WHEN a.age>b.age THEN a ELSE b END.age
RETURN a, b
Feedback should indicate that Set 1 property, and return Bob without age, Alice retaining age:
โโโโโโโโโโโโโโโโโโโโโโโโโโโคโโโโโโโโโโโโโโโ
โ"a" โ"b" โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโชโโโโโโโโโโโโโโโก
โ{"name":"Alice","age":23}โ{"name":"Bob"}โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโ
The following error is raised in Neo4j:
Neo.DatabaseError.Statement.ExecutionFailed
REMOVE RemovePropertyItem(Property(CaseExpression(None,Vector((GreaterThan(Property(Variable(a),PropertyKeyName(age)),Property(Variable(b),PropertyKeyName(age))),Variable(a))),Some(Variable(b))),PropertyKeyName(age))) not supported in cost planner yet
This issue was first raised in opencypher/openCypher#287, where @Mats-SX pointed out that this used to work in Neo4j 2.3 and also in Cypher 2.3 compatibility mode using Neo4j 3.x, i.e. the following query produces the expected result.
CYPHER 2.3
MATCH (a:Person {name: 'Alice'})-[:KNOWS]->(b:Person {name: 'Bob'})
REMOVE CASE WHEN a.age>b.age THEN a ELSE b END.age
RETURN a, b
@jmarton Thanks for reporting, this sounds like a bug in our cost planner. We will investigate this as soon as possible.
Best regards Louise, Neo4j Cypher team
@marton A fix for this bug will be included in the next patch releases for 3.2 and 3.3 (3.2.10 and 3.3.3)