Skip to content

Conversation

@rxin
Copy link
Contributor

@rxin rxin commented Aug 18, 2017

What changes were proposed in this pull request?

Dataset.sample requires a boolean flag withReplacement as the first argument. However, most of the time users simply want to sample some records without replacement. This ticket introduces a new sample function that simply takes in the fraction and seed.

How was this patch tested?

Tested manually. Not sure yet if we should add a test case for just this wrapper ...

@mengxr
Copy link
Contributor

mengxr commented Aug 18, 2017

LGTM

@SparkQA
Copy link

SparkQA commented Aug 18, 2017

Test build #80824 has finished for PR 18988 at commit a21d8b0.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member

retest this please

@SparkQA
Copy link

SparkQA commented Aug 18, 2017

Test build #80831 has finished for PR 18988 at commit a21d8b0.

  • This patch fails SparkR unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member

retest this please

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM, too.

@SparkQA
Copy link

SparkQA commented Aug 18, 2017

Test build #80836 has finished for PR 18988 at commit a21d8b0.

  • This patch fails PySpark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member

retest this please

@SparkQA
Copy link

SparkQA commented Aug 18, 2017

Test build #80844 has finished for PR 18988 at commit a21d8b0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member

LGTM too.

@HyukjinKwon
Copy link
Member

Merged to master.

I am hitting network issue. Will update the JIRA manually later.

@asfgit asfgit closed this in 07a2b87 Aug 18, 2017
@rxin
Copy link
Contributor Author

rxin commented Aug 18, 2017

Thanks. Do you want to add the Python and R ones?

It is a little bit tricky because in Python we would need to detect whether withReplacement is a boolean or a floating point value. If it is a floating point value then we should treat it as the fraction. We better add a test there given the complexity ...

@HyukjinKwon
Copy link
Member

Yes.. I checked that too. Sure, let me give a try!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants