Skip to content

Commit

Permalink
isolating rJava
Browse files Browse the repository at this point in the history
  • Loading branch information
hrbrmstr committed Jun 16, 2017
1 parent 41729ce commit f7248b2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
4 changes: 4 additions & 0 deletions R/jdbc.r
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#' }
drill_jdbc <- function(nodes="localhost:2181", cluster_id=NULL, schema=NULL, use_zk=TRUE) {

if (!requireNamespace("rJava")) {
stop("RJDBC & rJava are required to use the Drill JDBC connectors", .call=FALSE)
}

if (!requireNamespace("RJDBC")) {
stop("RJDBC & rJava are required to use the Drill JDBC connectors", .call=FALSE)
}
Expand Down
4 changes: 4 additions & 0 deletions R/query.r
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ drill_query <- function(drill_con, query, uplift=TRUE, .progress=interactive())

if (inherits(drill_con, "JDBCConnection")) {

if (!requireNamespace("rJava")) {
stop("RJDBC & rJava are required to use the Drill JDBC connectors", .call=FALSE)
}

if (!requireNamespace("RJDBC")) {
stop("RJDBC & rJava are required to use the Drill JDBC connectors", .call=FALSE)
}
Expand Down
6 changes: 3 additions & 3 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.onLoad <- function(libname, pkgname) {
if (requireNamespace("rJava")) rJava::.jpackage(pkgname, lib.loc = libname)
}
# .onLoad <- function(libname, pkgname) {
# if (requireNamespace("rJava")) rJava::.jpackage(pkgname, lib.loc = libname)
# }
4 changes: 2 additions & 2 deletions man/DrillConnection-class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f7248b2

Please sign in to comment.