[ 
https://issues.apache.org/jira/browse/SPARK-6812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14530106#comment-14530106
 ] 

Sun Rui commented on SPARK-6812:
--------------------------------

According to the R manual: 
https://stat.ethz.ch/R-manual/R-devel/library/base/html/Startup.html,
" if a function .First is found on the search path, it is executed as .First(). 
Finally, function .First.sys() in the base package is run. This calls require 
to attach the default packages specified by options("defaultPackages")."

In .First() in profile/shell.R, we load SparkR package. This means SparkR 
package is loaded before default packages. If there are same names in default 
packages, they will overwrite those in SparkR. This is why filter() in SparkR 
is masked by filter() in stats, which is usually in the default package list.

We need to make sure SparkR is loaded after default packages. The solution is 
to append SparkR to default packages, instead of loading SparkR in .First().


> filter() on DataFrame does not work as expected
> -----------------------------------------------
>
>                 Key: SPARK-6812
>                 URL: https://issues.apache.org/jira/browse/SPARK-6812
>             Project: Spark
>          Issue Type: Bug
>          Components: SparkR
>            Reporter: Davies Liu
>            Assignee: Sun Rui
>            Priority: Blocker
>
> {code}
> > filter(df, df$age > 21)
> Error in filter(df, df$age > 21) :
>   no method for coercing this S4 class to a vector
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to