~hrbrmstr/sergeant-caffeinated

ref: 135af6c1c0872d07fbd6df70bf876743976281ae sergeant-caffeinated/man/drill_jdbc.Rd -rw-r--r-- 2.7 KiB
135af6c1hrbrmstr 4j 1 year, 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/jdbc.r
\name{drill_jdbc}
\alias{drill_jdbc}
\alias{src_drill_jdbc}
\alias{tbl.src_drill_jdbc}
\title{Connect to Drill using JDBC}
\usage{
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
)

\method{tbl}{src_drill_jdbc}(src, from, ...)
}
\arguments{
\item{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.}

\item{cluster_id}{the cluster id from \code{drill-override.conf}}

\item{schema}{an optional schema name to append to the JDBC connection string}

\item{use_zk}{are you connecting to a ZooKeeper instance (default: \code{TRUE}) or
connecting to an individual DrillBit.}

\item{src}{A Drill "src" created with \code{src_drill()}}

\item{from}{A Drill view or table specification}

\item{...}{Extra parameters}
}
\value{
a JDBC connection object
}
\description{
The DRILL JDBC driver fully-qualified path must be placed in the
\code{DRILL_JDBC_JAR} environment variable. This is best done via \code{~/.Renviron}
for interactive work. e.g. \code{DRILL_JDBC_JAR=/usr/local/drill/jars/jdbc-driver/drill-jdbc-all-1.10.0.jar}
}
\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()].
}
\examples{
\dontrun{
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)
}
}
\references{
\url{https://drill.apache.org/docs/using-the-jdbc-driver/#using-the-jdbc-url-for-a-random-drillbit-connection}
}
\seealso{
Other Drill JDBC API: 
\code{\link{DrillJDBC}()},
\code{\link{dbConnect,DrillJDBCDriver-method}},
\code{\link{dbDataType,DrillJDBCConnection-method}},
\code{\link{db_data_type.DrillJDBCConnection}()}

Other Drill JDBC API: 
\code{\link{DrillJDBC}()},
\code{\link{dbConnect,DrillJDBCDriver-method}},
\code{\link{dbDataType,DrillJDBCConnection-method}},
\code{\link{db_data_type.DrillJDBCConnection}()}

Other Drill JDBC API: 
\code{\link{DrillJDBC}()},
\code{\link{dbConnect,DrillJDBCDriver-method}},
\code{\link{dbDataType,DrillJDBCConnection-method}},
\code{\link{db_data_type.DrillJDBCConnection}()}
}
\concept{Drill JDBC API}