简体   繁体   English

Gremlin 查询适用于 TinkerGraph、JanusGraph 和 Neo4j 但不适用于 DSE Graph 6.8.1

[英]Gremlin query works in TinkerGraph, JanusGraph and Neo4j but not in DSE Graph 6.8.1

I have the following query which works without any issues with TinkerGraph, JanusGraph and Neo4j-Gremlin:我有以下查询,它与 TinkerGraph、JanusGraph 和 Neo4j-Gremlin 没有任何问题:

g.V().has('Account','address','0x0').
    out('sent').has('eventName','Transfer').as('t1').
    out('received_by').has('type','EOA').has('status','Active').as('a2').
    out('sent').has('eventName','Transfer').as('t2').
    where('t1',eq('t2')).by('address').
    where('t1',eq('t2')).by('amount').
    out('received_by').has('type','EOA').has('status','Active').as('a3').
    select('a3','a2').
        by('address').
    group().
        by('a3').
        by('a2').
    unfold().
    where(select(values).limit(local,2).count(local).is(gte(2).and(lte(1000))))

But with DataStax Graph I get the following error:但是使用 DataStax Graph 我得到以下错误:

java.util.LinkedHashMap cannot be cast to org.apache.tinkerpop.gremlin.structure.Element

I know the issue is after the select but I haven't been able to figure out in which point is really failing.我知道问题出在 select 之后,但我无法弄清楚哪一点真正失败了。 Any ideas would help.任何想法都会有所帮助。 Thanks.谢谢。

DataStax Graph 6.8.1 uses an early release of TinkerPop 3.4.5. DataStax Graph 6.8.1 使用 TinkerPop 3.4.5 的早期版本。 That release does not contain the full release feature that allows by(String) to work on a Map .该版本不包含允许by(String)Map上工作的完整版本功能 You should be able to re-write your traversal to:您应该能够将遍历重写为:

g.V().has('Account','address','0x0').
    out('sent').has('eventName','Transfer').as('t1').
    out('received_by').has('type','EOA').has('status','Active').as('a2').
    out('sent').has('eventName','Transfer').as('t2').
    where('t1',eq('t2')).by('address').
    where('t1',eq('t2')).by('amount').
    out('received_by').has('type','EOA').has('status','Active').as('a3').
    select('a3','a2').
        by('address').
    group().
        by(select('a3')).
        by(select('a2').fold()).
    unfold().
    where(select(values).limit(local,2).count(local).is(gte(2).and(lte(1000))))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM