-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-11209][SPARKR] Add window functions into SparkR [step 1]. #9193
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
Conversation
|
Test build #44043 has finished for PR 9193 at commit
|
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.
nit: this is kinda hard to read with the double negatives. consider:
if ((parameterType.isPrimitive || args(i) != null) &&
!parameterWrapperType.isInstance(args(i))) {
?
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.
OK. done.
Anyway, I feel painful that Scala does not support 'continue' statement. So the code here still not so good.
|
Test build #44050 has finished for PR 9193 at commit
|
|
Test build #44051 has finished for PR 9193 at commit
|
|
Jenkins, retest this please |
|
Test build #44128 has finished for PR 9193 at commit
|
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.
There is a method called lag in base R that this would conflict with. Could we try to use the same argument names as that function ?
|
@shivaram, R lag function is for time series objects, which is irrelevant to the lead/lag here in SQL window functions. There are some functions in dplyr package mimicing SQL window functions, including lead and lag. Refer to https://cran.r-project.org/web/packages/dplyr/vignettes/window-functions.html and https://cran.r-project.org/web/packages/dplyr/dplyr.pdf. But a quick glance at these functions shows that they are working on vectors (for example, lag right shifts a vector by offset), so the semantic of them are different from those in Spark. So for now I won't change this PR. |
|
Ok. The thing I was worried about is that if somebody loads SparkR they won't be able to use |
|
Yes. the lag will be masked. Just as discussed before, sometimes, this is allowed, as I assume lag is not so commonly and frequently used ("dplyr" masks lag also). Users can still use stats::lag if they do want to use it. |
|
Hmm I see. In the case of Otherwise LGTM. Merging this. |
|
@shivaram, for your suggestion that "we should a make a list of functions that we mask and are incompatible", I submitted https://issues.apache.org/jira/browse/SPARK-11339 |
No description provided.