You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Greg Hogan (JIRA)" <ji...@apache.org> on 2017/09/18 12:44:00 UTC
[jira] [Commented] (FLINK-7631) Ineffective check in
PageRank#open()
[ https://issues.apache.org/jira/browse/FLINK-7631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16169958#comment-16169958 ]
Greg Hogan commented on FLINK-7631:
-----------------------------------
Divide by zero is only an error for fixed-point arithmetic and here the numerator is a double.
> 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)