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)

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.

Value

a JDBC connection object

References

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

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) })