-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-15382][SQL] Fix a rule to push down projects beneath Sample #14181
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1534,15 +1534,15 @@ class Dataset[T] private[sql]( | |
| * Returns a new Dataset by sampling a fraction of rows. | ||
| * | ||
| * @param withReplacement Sample with replacement or not. | ||
| * @param fraction Fraction of rows to generate. | ||
| * @param fraction Fraction of rows to generate and the range is 0.0 <= `fraction` <= 1.0. | ||
| * @param seed Seed for sampling. | ||
| * | ||
| * @group typedrel | ||
| * @since 1.6.0 | ||
| */ | ||
| def sample(withReplacement: Boolean, fraction: Double, seed: Long): Dataset[T] = { | ||
| require(fraction >= 0, | ||
| s"Fraction must be nonnegative, but got ${fraction}") | ||
| require(fraction >= 0 && fraction <= 1.0, | ||
| s"Fraction range must be 0.0 <= `fraction` <= 1.0, but got ${fraction}") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @maropu, I just wonder if this fix is still needed though just to be consistent whether
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @HyukjinKwon oh, you're right and my bad... thanks! Since this original pr is far from this bug, I'll make a new jira ticket and a pr soon later. |
||
|
|
||
| withTypedPlan { | ||
| Sample(0.0, fraction, withReplacement, seed, logicalPlan)() | ||
|
|
@@ -1553,7 +1553,7 @@ class Dataset[T] private[sql]( | |
| * Returns a new Dataset by sampling a fraction of rows, using a random seed. | ||
| * | ||
| * @param withReplacement Sample with replacement or not. | ||
| * @param fraction Fraction of rows to generate. | ||
| * @param fraction Fraction of rows to generate and the range is 0.0 <= `fraction` <= 1.0. | ||
| * | ||
| * @group typedrel | ||
| * @since 1.6.0 | ||
|
|
||
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.
The second condition looks complicated. Just
projectList.forall(_.deterministic)?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.
yea, thanks! I'll fix this.