The spark-shell show may show an "ambiguous reference to overloaded definition" error for two functions:
GraphTraversal.by(Order) and GraphTraversal.by(Comparable)
Here is an example:
scala> g.V().values("name").order().by(Order.decr)
console>:43: error: ambiguous reference to overloaded definition,
both method by in trait GraphTraversal of type (x$1: org.apache.tinkerpop.gremlin.process.traversal.Order)org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal[org.apache.spark.sql.Row,E2]
and method by in trait GraphTraversal of type (x$1: java.util.Comparator[E2])org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal[org.apache.spark.sql.Row,E2]
match argument types (org.apache.tinkerpop.gremlin.process.traversal.Order)
To workaround this problem a user can directly cast Order to super class: Comparable
This is an inconvenient workaround, so this class replicates the Order interface but returns Comparable instead of Order.
Users should import this object to avoid the aforementioned issues.
The spark-shell show may show an "ambiguous reference to overloaded definition" error for two functions:
GraphTraversal.by(Order)
andGraphTraversal.by(Comparable)
Here is an example:
To workaround this problem a user can directly cast Order to super class: Comparable
scala> g.V().values("name").order().by(Order.decr.asInstanceOf[Order])
This is an inconvenient workaround, so this class replicates the Order interface but returns Comparable instead of Order. Users should import this object to avoid the aforementioned issues.