Skip to content

Conversation

@brkyvz
Copy link
Contributor

@brkyvz brkyvz commented Apr 4, 2016

What changes were proposed in this pull request?

The window function was added to Dataset with this PR.
This PR adds the R API for this function.

With this PR, SQL, Java, and Scala will share the same APIs as in users can use:

  • window(timeColumn, windowDuration)
  • window(timeColumn, windowDuration, slideDuration)
  • window(timeColumn, windowDuration, slideDuration, startTime)

In Python and R, users can access all APIs above, but in addition they can do

  • In R:
    window(timeColumn, windowDuration, startTime=...)

that is, they can provide the startTime without providing the slideDuration. In this case, we will generate tumbling windows.

How was this patch tested?

Unit tests + manual tests

@SparkQA
Copy link

SparkQA commented Apr 4, 2016

Test build #54819 has finished for PR 12141 at commit 9c63aeb.

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

#'}
setMethod("window", signature(x = "Column"),
function(x, windowDuration, slideDuration = NULL, startTime = NULL) {
if (!is.null(slideDuration) && !is.null(startTime)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Check we check the type of windowDuration, slideDuration and startTime?

@davies
Copy link
Contributor

davies commented Apr 4, 2016

@brkyvz LGTM, only one minor comment.

@brkyvz
Copy link
Contributor Author

brkyvz commented Apr 5, 2016

@davies Addressed your comment

@SparkQA
Copy link

SparkQA commented Apr 5, 2016

Test build #54917 has finished for PR 12141 at commit 215e708.

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

@brkyvz
Copy link
Contributor Author

brkyvz commented Apr 5, 2016

Retest this please
On Apr 4, 2016 6:09 PM, "UCB AMPLab" notifications@github.com wrote:

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/54917/
Test FAILed.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#12141 (comment)

"var_samp",
"weekofyear",
"when",
"window",
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

also need to check window from the stats package can still be called?
https://stat.ethz.ch/R-manual/R-devel/library/stats/html/window.html

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done. window can be called using stats::window

@brkyvz
Copy link
Contributor Author

brkyvz commented Apr 5, 2016

retest this please

@SparkQA
Copy link

SparkQA commented Apr 5, 2016

Test build #54930 has finished for PR 12141 at commit 215e708.

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

@SparkQA
Copy link

SparkQA commented Apr 5, 2016

Test build #54934 has finished for PR 12141 at commit 55c6925.

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

@SparkQA
Copy link

SparkQA commented Apr 5, 2016

Test build #54938 has finished for PR 12141 at commit f43c138.

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

@SparkQA
Copy link

SparkQA commented Apr 5, 2016

Test build #54946 has finished for PR 12141 at commit 09ab9a3.

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

}))
maskedCompletely <- masked[!funcHasAny]
namesOfMaskedCompletely <- c("cov", "filter", "sample")
namesOfMaskedCompletely <- c("cov", "filter", "sample", "window")
Copy link
Member

Choose a reason for hiding this comment

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

if this fails that means the current definition will block the stats::window function completely, (ie. user will not be able to call it without altering the code with stats:: prefix)
this is in fact delibrate - to avoid masking the function by accident. for instance, please set the generic (in R/pkg/R/generics.R) as window(x, ...) to match the stats package definition - generally that would allow both to be called at the same time.
@sun-rui @shivaram

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see... Thanks for pointing it out!

@SparkQA
Copy link

SparkQA commented Apr 5, 2016

Test build #54953 has finished for PR 12141 at commit 37f013f.

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

@davies
Copy link
Contributor

davies commented Apr 6, 2016

LGTM, merging into master.

@asfgit asfgit closed this in 1146c53 Apr 6, 2016
@brkyvz brkyvz deleted the R-windows branch February 3, 2019 20:59
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.

4 participants