Ted Yu created FLINK-7631:
-----------------------------
Summary: Ineffective check in PageRank#open()
Key: FLINK-7631
URL: https://issues.apache.org/jira/browse/FLINK-7631
Project: Flink
Issue Type: Bug
Reporter: Ted Yu
Priority: Minor
>From
>flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/library/linkanalysis/PageRank.java
> :
{code}
this.vertexCount = vertexCountIterator.hasNext() ?
vertexCountIterator.next().getValue() : 0;
this.uniformlyDistributedScore = ((1 - dampingFactor) + dampingFactor *
sumOfSinks) / this.vertexCount;
{code}
The check for vertexCountIterator.hasNext() should enclose the assignments to
both this.vertexCount and this.uniformlyDistributedScore
Otherwise there may be divide by zero error.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)