spark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ulanov, Alexander" <alexander.ula...@hpe.com>
Subject Graph edge type pattern matching in GraphX
Date Tue, 02 Aug 2016 12:29:10 GMT
Dear Spark developers,

Could you suggest how to perform pattern matching on the type of the graph edge in the following
scenario. I need to perform some math by means of aggregateMessages on the graph edges if
edges are Double. Here is the code:
def my[VD: ClassTag, ED: ClassTag] (graph: Graph[VD, ED]): Double {
graph match {
   g: Graph[_, Double] => g.aggregateMessages[Double](t => t.sendToSrc(t.attr), _ +
_).values.max
   _ => 0.0
}
}

However, it does not work, because aggregateMessages creates context t of type [VD, ED, Double].
I expect it to create context of [VD, Double, Double] because of the type pattern matching.
Could you suggest what is the issue?

Best regards, Alexander

Mime
View raw message