[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=16189835#comment-16189835 ] Greg Hogan commented on FLINK-7631: --- When `vertexCount` is zero the map function will not be called. > 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)
[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=16178375#comment-16178375 ] Ted Yu commented on FLINK-7631: --- Looking at rest of the class, the use of uniformlyDistributedScore doesn't seem to handle {{Infinity}} > 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)
[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=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)