[jira] [Commented] (SPARK-16961) Utils.randomizeInPlace does not shuffle arrays uniformly

2016-08-20 Thread Apache Spark (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-16961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15429280#comment-15429280
 ] 

Apache Spark commented on SPARK-16961:
--

User 'yanboliang' has created a pull request for this issue:
https://github.com/apache/spark/pull/14730

> Utils.randomizeInPlace does not shuffle arrays uniformly
> 
>
> Key: SPARK-16961
> URL: https://issues.apache.org/jira/browse/SPARK-16961
> Project: Spark
>  Issue Type: Bug
>  Components: Spark Core
>Affects Versions: 2.0.0
>Reporter: Nicholas
>Assignee: Nicholas
>Priority: Minor
> Fix For: 2.0.1, 2.1.0
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> The Utils.randomizeInPlace method, which is meant to uniformly shuffle the 
> elements on an input array, never shuffles elements to their starting 
> position. That is, every permutation of the input array is equally likely to 
> be returned, except for any permutation in which any element is in the same 
> position where it began. These permutations are never output.
> This is because line 827 of Utils.scala should be
> {{val j = rand.nextInt(i + 1)}}
> instead of
> {{val j = rand.nextInt( i )}}



--
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



[jira] [Commented] (SPARK-16961) Utils.randomizeInPlace does not shuffle arrays uniformly

2016-08-08 Thread Apache Spark (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-16961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15412783#comment-15412783
 ] 

Apache Spark commented on SPARK-16961:
--

User 'nicklavers' has created a pull request for this issue:
https://github.com/apache/spark/pull/14551

> Utils.randomizeInPlace does not shuffle arrays uniformly
> 
>
> Key: SPARK-16961
> URL: https://issues.apache.org/jira/browse/SPARK-16961
> Project: Spark
>  Issue Type: Bug
>  Components: Spark Core
>Affects Versions: 2.0.0
>Reporter: Nicholas
>Priority: Minor
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> The Utils.randomizeInPlace method, which is meant to uniformly shuffle the 
> elements on an input array, never shuffles elements to their starting 
> position. That is, every permutation of the input array is equally likely to 
> be returned, except for any permutation in which any element is in the same 
> position where it began. These permutations are never output.
> This is because line 827 of Utils.scala should be
> {{val j = rand.nextInt(i + 1)}}
> instead of
> {{val j = rand.nextInt( i )}}



--
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



[jira] [Commented] (SPARK-16961) Utils.randomizeInPlace does not shuffle arrays uniformly

2016-08-08 Thread Nicholas (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-16961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15412705#comment-15412705
 ] 

Nicholas commented on SPARK-16961:
--

I am submitting a PR

> Utils.randomizeInPlace does not shuffle arrays uniformly
> 
>
> Key: SPARK-16961
> URL: https://issues.apache.org/jira/browse/SPARK-16961
> Project: Spark
>  Issue Type: Bug
>  Components: Spark Core
>Affects Versions: 2.0.0
>Reporter: Nicholas
>Priority: Minor
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> The Utils.randomizeInPlace method, which is meant to uniformly shuffle the 
> elements on an input array, never shuffles elements to their starting 
> position. That is, every permutation of the input array is equally likely to 
> be returned, except for any permutation in which any element is in the same 
> position where it began. These permutations are never output.
> This is because line 827 of Utils.scala should be
> {{val j = rand.nextInt(i + 1)}}
> instead of
> {{val j = rand.nextInt( i )}}



--
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