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

ContainerIndex unsupported in where/case/when #234

Closed mad closed 5 years ago

mad commented 5 years ago
MATCH (n)
WHERE 
  CASE split(n.name, '_')[0] 
    WHEN split(n.name, '_')[1] THEN n.name
    ELSE NULL END IS NOT NULL
RETURN n.name
java.lang.UnsupportedOperationException: Unsupported value expression: ContainerIndex(FunctionInvocation(Namespace(List()),FunctionName(split) ...
at org.opencypher.gremlin.translation.context.WalkerContext.unsupported(WalkerContext.scala:69)
    at org.opencypher.gremlin.translation.walker.NodeUtils$.traversalValueToJava(NodeUtils.scala:75)
    at org.opencypher.gremlin.translation.walker.NodeUtils$.expressionValue(NodeUtils.scala:35)
    at org.opencypher.gremlin.translation.walker.ExpressionWalker$$anonfun$optionChoose$1$2.apply(ExpressionWalker.scala:570)
    at org.opencypher.g
dwitry commented 5 years ago

Hello @mad.

Requirement could be generalized as support of expressions as pick tokens in simple CASE form.

Its possible to implement. Gremlin query will be complex, because option step-modulator supports only constant values, so we need to use nested choose steps.

Can you please confirm that #235 resolves your requirement?

mad commented 5 years ago

Hello @dwitry, thanks for quick response and implementation

Yes, simple case form resolve our requirements