Topics

Coalesce() step behaves differently than Or() step, with exception in sum() step


cmilowka
 

I am trying to replace coalesce() by or() which is generally faster, but there is a problem with or() step failing in the following mum() step:
 
gremlin> graph3 = TinkerGraph.open()                                              ==>tinkergraph[vertices:0 edges:0]
gremlin> graph3.io(graphml()).readGraph('data/grateful-dead.xml')  ==>null
gremlin> g3 = graph3.traversal()                                                        ==>graphtraversalsource[tinkergraph[vertices:808 edges:8049], standard]
gremlin> g3.V('89').values("performances")                                       ==>219
gremlin> g3.V('89').values("performances").sum()                             ==>219
gremlin> g3.V('89').or(values("performances")).sum()                       ==> org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerVertex cannot be cast to java.lang.Number
gremlin> g3.V('89').or(values("performances"),__.constant("10000")).sum()  ==> org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerVertex cannot be cast to java.lang.Number
gremlin> g3.V('89').coalesce(values("performances"),__.constant("10000")).sum()  ==>219
 
Is an error, or wrong doing?
CM
 


hadoopmarc@...
 

This question is also asked to the gremlin user group, where it can be best answered:

https://groups.google.com/g/gremlin-users/c/-oBWRUxF_Hw