The DRILL JDBC driver fully-qualified path must be placed in the DRILL_JDBC_JAR environment variable. This is best done via ~/.Renviron for interactive work. e.g. DRILL_JDBC_JAR=/usr/local/drill/jars/jdbc-driver/drill-jdbc-all-1.10.0.jar

drill_jdbc(nodes = "localhost:2181", cluster_id = NULL, schema = NULL,
  use_zk = TRUE)

src_drill_jdbc(nodes = "localhost:2181", cluster_id = NULL, schema = NULL,
  use_zk = TRUE)

# S3 method for src_drill_jdbc
tbl(src, from, ...)

Arguments

nodes

character vector of nodes. If more than one node, you can either have a single string with the comma-separated node:port pairs pre-made or pass in a character vector with multiple node:port strings and the function will make a comma-separated node string for you.

cluster_id

the cluster id from drill-override.conf

schema

an optional schema name to append to the JDBC connection string

use_zk

are you connecting to a ZooKeeper instance (default: TRUE) or connecting to an individual DrillBit.

src

A Drill "src" created with src_drill()

from

A Drill view or table specification

...

Extra parameters

Value

a JDBC connection object

Details

[src_drill_jdbc()] wraps the JDBC [dbConnect()] connection instantation in [dbplyr::src_dbi()] to return the equivalent of the REST driver's [src_drill()].

References

https://drill.apache.org/docs/using-the-jdbc-driver/#using-the-jdbc-url-for-a-random-drillbit-connection

See also

Examples

# NOT RUN {
con <- drill_jdbc("localhost:2181", "main")
drill_query(con, "SELECT * FROM cp.`employee.json`")

# you can also use the connection with RJDBC calls:
dbGetQuery(con, "SELECT * FROM cp.`employee.json`")

# for local/embedded mode with default configuration info
con <- drill_jdbc("localhost:31010", use_zk=FALSE)
# }