spark-shell show error: "ambiguous reference to overloaded definition"
for two functions:
GraphTraversal.by(Order)
GraphTraversal.by(Comparable)
*
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 you should directly cast Order to super class: Comparable
scala> g.V().values("name").order().by(Order.decr.asInstanceOf[Order])
that is inconvenient for user.
This class is replicate the Order interface but returns Comparable instread of Order.
It is used in spark-shell imports
spark-shell show error: "ambiguous reference to overloaded definition" for two functions: GraphTraversal.by(Order) GraphTraversal.by(Comparable) * 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 you should directly cast Order to super class: Comparable scala> g.V().values("name").order().by(Order.decr.asInstanceOf[Order])
that is inconvenient for user. This class is replicate the Order interface but returns Comparable instread of Order. It is used in spark-shell imports