-
- Downloads
[SPARK-15382][SQL] Fix a bug in sampling with replacement
## What changes were proposed in this pull request? This pr to fix a bug below in sampling with replacement ``` val df = Seq((1, 0), (2, 0), (3, 0)).toDF("a", "b") df.sample(true, 2.0).withColumn("c", monotonically_increasing_id).select($"c").show +---+ | c| +---+ | 0| | 1| | 1| | 1| | 2| +---+ ``` ## How was this patch tested? Added a test in `DataFrameSuite`. Author: Takeshi YAMAMURO <linguin.m.s@gmail.com> Closes #14800 from maropu/FixSampleBug.
Showing
- sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala 1 addition, 0 deletions...g/apache/spark/sql/execution/basicPhysicalOperators.scala
- sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala 7 additions, 0 deletions.../src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
Loading
Please register or sign in to comment