opencypher / cypher-for-gremlin

Cypher for Gremlin adds Cypher support to any Gremlin graph database.
Apache License 2.0
359 stars 48 forks source link

CASE expression failed #268

Closed mad closed 5 years ago

mad commented 5 years ago

Sample query

MATCH (n:test)
RETURN 
  CASE split(n.name, '_')[0] 
    WHEN split(n.name, '_')[1] THEN toString(n.name + 'a')
    ELSE NULL
  END as r

Exception:

21:55:11.396 [gremlin-server-worker-1] WARN  o.a.t.g.s.h.OpExecutorHandler - Unsupported value expression: Add(Property(Variable(n),PropertyKeyName(name)),StringLiteral(a))
java.lang.UnsupportedOperationException: Unsupported value expression: Add(Property(Variable(n),PropertyKeyName(name)),StringLiteral(a))
    at org.opencypher.gremlin.translation.context.WalkerContext.unsupported(WalkerContext.scala:69)
    at org.opencypher.gremlin.translation.walker.NodeUtils$.traversalValueToJava(NodeUtils.scala:51)
    at org.opencypher.gremlin.translation.walker.NodeUtils$.expressionValue(NodeUtils.scala:35)
    at org.opencypher.gremlin.translation.walker.NodeUtils$.traversalValueOption(NodeUtils.scala:74)
    at org.opencypher.gremlin.translation.walker.ExpressionWalker.$anonfun$caseExpression$4(ExpressionWalker.scala:612)
dwitry commented 5 years ago

Resolved by #269