Skip to content

Commit b569145

Browse files
author
Sun Rui
committed
[SPARK-6812][SparkR] filter() on DataFrame does not work as expected.
1 parent 0092abb commit b569145

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

R/pkg/inst/profile/shell.R

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@
2020
.libPaths(c(file.path(home, "R", "lib"), .libPaths()))
2121
Sys.setenv(NOAWT=1)
2222

23-
library(utils)
24-
library(SparkR)
25-
sc <- sparkR.init(Sys.getenv("MASTER", unset = ""))
23+
# Make sure SparkR package is the last loaded one
24+
old <- getOption("defaultPackages")
25+
options(defaultPackages = c(old, "SparkR"))
26+
27+
sc <- SparkR::sparkR.init(Sys.getenv("MASTER", unset = ""))
2628
assign("sc", sc, envir=.GlobalEnv)
27-
sqlCtx <- sparkRSQL.init(sc)
29+
sqlCtx <- SparkR::sparkRSQL.init(sc)
2830
assign("sqlCtx", sqlCtx, envir=.GlobalEnv)
2931
cat("\n Welcome to SparkR!")
3032
cat("\n Spark context is available as sc, SQL context is available as sqlCtx\n")

0 commit comments

Comments
 (0)