-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-11339][SPARKR] Document the list of functions in R base package that are masked by functions with same name in SparkR #9785
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 #46135 has finished for PR 9785 at commit
|
|
Test build #46137 has finished for PR 9785 at commit
|
|
Test build #46140 has finished for PR 9785 at commit
|
|
For things which are missing generics we can add a generic in our |
|
It passes locally, it looks like it failing something to do with unicode - any idea? |
|
@shivaram I checked that - it didn't work with subset even when signature matched. I think that's only affect S4 but when something, like |
|
For the unicode thing I think there is a problem with the |
|
BTW I just made this local change and after this both work correctly for me. |
|
ok, I see. I guess I picked the closer form I'll try/fix the other ones too. |
|
Yeah I think the trick is to pick the least specific one and set a generic for that |
|
I fixed subset, lag, and filter. Not sure about the rest: For For |
|
Test build #46188 has finished for PR 9785 at commit
|
|
I am not sure if it makes sense to match SparkR functions to R signatures of same name to avoid name conflict in the case that SparkR functions have different semantic from R. Is it a convenience to R users or a confusion? This will interfere with a call to base lag(), where x is of type character. |
|
So my take on this is as follows:
|
|
Test build #46235 has finished for PR 9785 at commit
|
|
@shivaram agreed completely. |
|
rebased again for merge conflict |
|
Test build #46281 has finished for PR 9785 at commit
|
|
Actually can we revert the change to |
|
Ok, am I understanding it correctly? They don't make it compatible doesn't mean we should follow right? before: after: |
|
Its less about the change to the SparkR code - I worry that the generic we are exporting is not really that "generic" and its very specific instead. In the case of things like |
|
Test build #46299 has finished for PR 9785 at commit
|
|
Test build #46309 has finished for PR 9785 at commit
|
|
Test build #46312 has finished for PR 9785 at commit
|
|
LGTM. Thanks @felixcheung ! Merging this to master and 1.6 |
…e that are masked by functions with same name in SparkR
Added tests for function that are reported as masked, to make sure the base:: or stats:: function can be called.
For those we can't call, added them to SparkR programming guide.
It would seem to me `table, sample, subset, filter, cov` not working are not actually expected - I investigated/experimented with them but couldn't get them to work. It looks like as they are defined in base or stats they are missing the S3 generic, eg.
```
> methods("transform")
[1] transform,ANY-method transform.data.frame
[3] transform,DataFrame-method transform.default
see '?methods' for accessing help and source code
> methods("subset")
[1] subset.data.frame subset,DataFrame-method subset.default
[4] subset.matrix
see '?methods' for accessing help and source code
Warning message:
In .S3methods(generic.function, class, parent.frame()) :
function 'subset' appears not to be S3 generic; found functions that look like S3 methods
```
Any idea?
More information on masking:
http://www.ats.ucla.edu/stat/r/faq/referencing_objects.htm
http://www.sfu.ca/~sweldon/howTo/guide4.pdf
This is what the output doc looks like (minus css):

Author: felixcheung <[email protected]>
Closes #9785 from felixcheung/rmasked.
(cherry picked from commit 1a93323)
Signed-off-by: Shivaram Venkataraman <[email protected]>
Added tests for function that are reported as masked, to make sure the base:: or stats:: function can be called.
For those we can't call, added them to SparkR programming guide.
It would seem to me
table, sample, subset, filter, covnot working are not actually expected - I investigated/experimented with them but couldn't get them to work. It looks like as they are defined in base or stats they are missing the S3 generic, eg.Any idea?
More information on masking:
http://www.ats.ucla.edu/stat/r/faq/referencing_objects.htm
http://www.sfu.ca/~sweldon/howTo/guide4.pdf
This is what the output doc looks like (minus css):
