-
Notifications
You must be signed in to change notification settings - Fork 28.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-7156][SQL] add randomSplit to DataFrame. #5711
Conversation
Can one of the admins verify this patch? |
val normalizedCumWeights = weights.map(_ / sum).scanLeft(0.0d)(_ + _) | ||
normalizedCumWeights.sliding(2).map { x => | ||
this.sqlContext.createDataFrame(new PartitionwiseSampledRDD[Row, Row]( | ||
rdd, new BernoulliCellSampler[Row](x(0), x(1)), true, seed), schema) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this actually breaks the plan -- can we create a logical operator (or generalizes the existing Sample operator) so the returned DataFrame correctly preserves the logical plan?
Thanks for working on this, @kaka1992. Would be great if we can do it in a way that doesn't break the existing logical plan for data frames. |
Can I add InMemoryRelation upon the base logicalPlan? Then I could create several randomSplit plans with the same data. @rxin I'm not sure if this way would break something. |
Somebody else submitted a PR based on your change and my review feedback. |
@rxin No problem. I'll close the pr. |
This is built on top of kaka1992 's PR #5711 using Logical plans. Author: Burak Yavuz <brkyvz@gmail.com> Closes #5761 from brkyvz/random-sample and squashes the following commits: a1fb0aa [Burak Yavuz] remove unrelated file 69669c3 [Burak Yavuz] fix broken test 1ddb3da [Burak Yavuz] copy base 6000328 [Burak Yavuz] added python api and fixed test 3c11d1b [Burak Yavuz] fixed broken test f400ade [Burak Yavuz] fix build errors 2384266 [Burak Yavuz] addressed comments v0.1 e98ebac [Burak Yavuz] [SPARK-7156][SQL] support RandomSplit in DataFrames
This is built on top of kaka1992 's PR apache#5711 using Logical plans. Author: Burak Yavuz <brkyvz@gmail.com> Closes apache#5761 from brkyvz/random-sample and squashes the following commits: a1fb0aa [Burak Yavuz] remove unrelated file 69669c3 [Burak Yavuz] fix broken test 1ddb3da [Burak Yavuz] copy base 6000328 [Burak Yavuz] added python api and fixed test 3c11d1b [Burak Yavuz] fixed broken test f400ade [Burak Yavuz] fix build errors 2384266 [Burak Yavuz] addressed comments v0.1 e98ebac [Burak Yavuz] [SPARK-7156][SQL] support RandomSplit in DataFrames
This is built on top of kaka1992 's PR apache#5711 using Logical plans. Author: Burak Yavuz <brkyvz@gmail.com> Closes apache#5761 from brkyvz/random-sample and squashes the following commits: a1fb0aa [Burak Yavuz] remove unrelated file 69669c3 [Burak Yavuz] fix broken test 1ddb3da [Burak Yavuz] copy base 6000328 [Burak Yavuz] added python api and fixed test 3c11d1b [Burak Yavuz] fixed broken test f400ade [Burak Yavuz] fix build errors 2384266 [Burak Yavuz] addressed comments v0.1 e98ebac [Burak Yavuz] [SPARK-7156][SQL] support RandomSplit in DataFrames
This is built on top of kaka1992 's PR apache#5711 using Logical plans. Author: Burak Yavuz <brkyvz@gmail.com> Closes apache#5761 from brkyvz/random-sample and squashes the following commits: a1fb0aa [Burak Yavuz] remove unrelated file 69669c3 [Burak Yavuz] fix broken test 1ddb3da [Burak Yavuz] copy base 6000328 [Burak Yavuz] added python api and fixed test 3c11d1b [Burak Yavuz] fixed broken test f400ade [Burak Yavuz] fix build errors 2384266 [Burak Yavuz] addressed comments v0.1 e98ebac [Burak Yavuz] [SPARK-7156][SQL] support RandomSplit in DataFrames
SPARK-7156 add randomSplit to DataFrame.