[ https://issues.apache.org/jira/browse/SPARK-3578?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joseph E. Gonzalez resolved SPARK-3578. --------------------------------------- Resolution: Fixed Fix Version/s: 1.2.0 Resolved by https://github.com/apache/spark/pull/2439 > GraphGenerators.sampleLogNormal sometimes returns too-large result > ------------------------------------------------------------------ > > Key: SPARK-3578 > URL: https://issues.apache.org/jira/browse/SPARK-3578 > Project: Spark > Issue Type: Bug > Components: GraphX > Affects Versions: 1.2.0 > Reporter: Ankur Dave > Assignee: Ankur Dave > Priority: Minor > Fix For: 1.2.0 > > > GraphGenerators.sampleLogNormal is supposed to return an integer strictly > less than maxVal. However, it violates this guarantee. It generates its > return value as follows: > {code} > var X: Double = maxVal > while (X >= maxVal) { > val Z = rand.nextGaussian() > X = math.exp(mu + sigma*Z) > } > math.round(X.toFloat) > {code} > When X is sampled to be close to (but less than) maxVal, then it will pass > the while loop condition, but the rounded result will be equal to maxVal, > which will fail the test. > For example, if maxVal is 5 and X is 4.9, then X < maxVal, but > math.round(X.toFloat) is 5. > A solution is to round X down instead of to the nearest integer. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org