~hrbrmstr/sergeant

e5c54599d953037f0994605f61ea1077eb0dd77d — hrbrmstr 11 months ago 2531ca8
dplyr 1.0.0 / {tinytest}
M DESCRIPTION => DESCRIPTION +13 -12
@@ 1,6 1,6 @@
Package: sergeant
Title: Tools to Transform and Query Data with 'Apache' 'Drill'
Version: 0.8.0
Title: Tools to Transform and Query Data with Apache Drill
Version: 0.9.0
Authors@R: c(
      person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre"), 
             comment = c(ORCID = "0000-0001-5670-2640")),


@@ 10,14 10,14 @@ Authors@R: c(
      person("David", "Severski", email = "davidski@deadheaven.com", role = "ctb",
        comment = c(ORCID = "https://orcid.org/0000-0001-7867-0459"))
    )
Description: 'Apache Drill' is a low-latency distributed query engine designed to enable 
    data exploration and 'analytics' on both relational and non-relational 'datastores', 
    scaling to petabytes of data. Methods are provided that enable working with 'Apache' 
    'Drill' instances via the 'REST' 'API', 'JDBC' interface (optional), 'DBI' 'methods'
Description: Apache Drill is a low-latency distributed query engine designed to enable 
    data exploration and analytics on both relational and non-relational datastores, 
    scaling to petabytes of data. Methods are provided that enable working with Apache 
    Drill instances via the REST API, JDBC interface (optional), DBI methods
    and using 'dplyr'/'dbplyr' idioms. Helper functions are included to facilitate
    using official 'Drill' 'Docker' images/containers.
    using official Drill Docker images/containers.
Depends:
    R (>= 3.2.0)
    R (>= 3.6.0)
URL: https://gitlab.com/hrbrmstr/sergeant
BugReports: https://gitlab.com/hrbrmstr/sergeant/issues
License: MIT + file LICENSE


@@ 26,22 26,23 @@ LazyData: true
Imports: 
    bit64 (>= 0.9-7),
    DBI (>= 0.7),
    dplyr (>= 0.7.0),
    dbplyr (>= 1.1.0),
    dplyr (>= 0.8.0),
    dbplyr (>= 1.3.0),
    httr (>= 1.2.1),
    jsonlite (>= 1.5.0),
    htmltools (>= 0.3.6),
    readr (>= 1.1.1),
    purrr (>= 0.2.2),
    scales (>= 0.4.1),
    tibble,
    utils,
    methods,
    magrittr (>= 1.5)
Suggests:
    DT (>= 0.5),
    stevedore,
    testthat (>= 1.0.2),
    tinytest,
    covr (>= 3.0.0),
    DBItest
RoxygenNote: 6.1.1
RoxygenNote: 7.1.0
Roxygen: list(markdown = TRUE)

M NAMESPACE => NAMESPACE +1 -0
@@ 103,3 103,4 @@ importFrom(purrr,map2)
importFrom(purrr,map2_df)
importFrom(readr,type_convert)
importFrom(scales,comma)
importFrom(tibble,as_tibble)

M NEWS.md => NEWS.md +3 -2
@@ 1,4 1,4 @@
# sergeant 0.8.0 (in-progress)
# sergeant 0.8.0

- Column order preserved in REST API & REST API DBI-based calls if
  using Apache Drill 1.15.0+ (Addresses #18)


@@ 17,7 17,8 @@
  columns to `BIGINT`
- Added `ctas_profile()` to automagically create a CTAS query from 
  a Drill `tbl` (Ref: #29 / inspired by David Severski)
- Added more tests to cover DBI and extended d[b]plyr operations
- Switched to the more diminuitive {tinytest}
- Added more tests to cover DBI and extended/new d[b]plyr operations

# sergeant 0.7.0-BETA


M R/dbi.r => R/dbi.r +2 -2
@@ 331,7 331,7 @@ setMethod(
        }) -> col_types

        suppressMessages(
          dplyr::tbl_df(
          tibble::as_tibble(
            readr::type_convert(
              df = xdf,
              col_types = paste0(col_types, collapse=""),


@@ 343,7 343,7 @@ setMethod(
      } else {

        suppressMessages(
          dplyr::tbl_df(
          tibble::as_tibble(
            readr::type_convert(df = xdf, na = character())
          )
        ) -> xdf

M R/dplyr.r => R/dplyr.r +2 -1
@@ 80,9 80,10 @@ src_drill <- function(host  = Sys.getenv("DRILL_HOST", "localhost"),
#'
#' @rdname src_tbls
#' @param x x
#' @param ... ignored
#' @family Drill REST `dplyr` API
#' @export
src_tbls.src_drill <- function(x) {
src_tbls.src_drill <- function(x, ...) {
  tmp <- dbGetQuery(x$con, "SHOW DATABASES")
  paste0(unlist(tmp$SCHEMA_NAME, use.names=FALSE), collapse=", ")
}

M R/query.r => R/query.r +3 -3
@@ 33,7 33,7 @@ drill_query <- function(drill_con, query, uplift=TRUE, .progress=interactive()) 
    try_require("RJDBC")
    try_require("sergeant.caffeinated")

    dplyr::tbl_df(dbGetQuery(drill_con, query))
    tibble::as_tibble(dbGetQuery(drill_con, query))

  } else {



@@ 207,7 207,7 @@ drill_uplift <- function(query_result) {
    }) -> col_types

    suppressMessages(
      dplyr::tbl_df(
      tibble::as_tibble(
        readr::type_convert(
          df = query_result$rows,
          col_types = paste0(col_types, collapse=""),


@@ 219,7 219,7 @@ drill_uplift <- function(query_result) {
  } else {

    suppressMessages(
      dplyr::tbl_df(
      tibble::as_tibble(
        readr::type_convert(df = query_result$rows, na = character())
      )
    ) -> xdf

M R/rest-api.r => R/rest-api.r +2 -2
@@ 206,7 206,7 @@ drill_storage <- function(drill_con, plugin=NULL, as=c("tbl", "list", "raw")) {

  switch(
    as,
    tbl = jsonlite::fromJSON(out, flatten=TRUE) %>% dplyr::tbl_df(),
    tbl = jsonlite::fromJSON(out, flatten=TRUE) %>% tibble::as_tibble(),
    list = jsonlite::fromJSON(
      out, simplifyVector = TRUE, simplifyDataFrame = FALSE, flatten = FALSE
    ),


@@ 275,7 275,7 @@ drill_options <- function(drill_con, pattern=NULL) {
  httr::stop_for_status(res)
  cnt <- httr::content(res, as="text", encoding="UTF-8")
  jsonlite::fromJSON(cnt) %>%
    dplyr::tbl_df() -> out
    tibble::as_tibble() -> out
  if (!is.null(pattern)) out <- dplyr::filter(out, grepl(pattern, name))
  out
}

M R/schemas.R => R/schemas.R +1 -1
@@ 23,7 23,7 @@ drill_show_schemas <- function(drill_con, .progress=interactive()) {
drill_use <- function(drill_con, schema_name, .progress=interactive()) {
  query <- sprintf("USE `%s`", schema_name)
  out <- drill_query(drill_con, query, .progress = .progress)
  if (!("errorMessage" %in% names(out))) message(out)
  if (("errorMessage" %in% names(out))) message(str(out, 2))
  invisible(out)
}


M R/sergeant-package.r => R/sergeant-package.r +1 -0
@@ 36,6 36,7 @@
#' @importFrom scales comma
#' @importFrom purrr map map2 map2_df %>%
#' @importFrom readr type_convert
#' @importFrom tibble as_tibble
#' @importFrom dplyr mutate select left_join bind_cols bind_rows data_frame tbl filter
#' @importFrom dplyr db_desc src db_data_type db_explain sql_translate_env copy_to
#' @importFrom dplyr db_query_fields src_tbls sql_escape_ident case_when collect

M README.md => README.md +1 -1
@@ 14,7 14,7 @@ Tools to Transform and Query Data with ‘Apache’ ‘Drill’

## \*\* IMPORTANT \*\*

Version 0.7.0 (a.k.a. the main branch) splits off the JDBC interface
Version 0.7.0+ (a.k.a. the main branch) splits off the JDBC interface
into a separate package `sergeant.caffeinated`
([GitLab](https://gitlab.com/hrbrmstr/sergeant-caffeinated);
[GitHub](https://github.com/hrbrmstr/sergeant-caffeinated)).

R tests/testthat/test-dbi-internal.R => inst/tinytest/test-dbi-internal.R +5 -8
@@ 2,13 2,10 @@ test_host <- Sys.getenv("DRILL_TEST_HOST", "localhost")

options(sergeant.bigint.warnonce = FALSE)

context("dbi")
test_that("core DBI ops work", {

  testthat::skip_on_cran()
if (at_home()) {

  con <- dbConnect(Drill(), test_host)
  expect_is(con, "DrillConnection")
  expect_true(inherits(con, "DrillConnection"))

  expect_true(dbIsValid(con))



@@ 26,7 23,7 @@ test_that("core DBI ops work", {
  )

  res <- dbSendQuery(con, "SELECT full_name from cp.`employee.json` LIMIT 1")
  expect_is(res, "DrillResult")
  expect_true(inherits(res, "DrillResult"))

  xdf <- dbFetch(res)
  expect_identical(dim(xdf), c(1L, 1L))


@@ 42,9 39,9 @@ test_that("core DBI ops work", {
  expect_equal(dbDataType(con, bit64::integer64(0)), "BIGINT")
  expect_equal(dbDataType(con, numeric(0)), "DOUBLE")

  expect_is(dbGetInfo(Drill()), "list")
  expect_true(inherits(dbGetInfo(Drill()), "list"))

  inf <- dbGetInfo(con)
  expect_equal(inf$port, 8047)

})
}

R tests/testthat/test-dbitest.R => inst/tinytest/test-dbitest.R +36 -37
@@ 2,57 2,56 @@ test_host <- Sys.getenv("DRILL_TEST_HOST", "localhost")

options(sergeant.bigint.warnonce = FALSE)

testthat::skip_on_cran()
if (at_home()) {

expect_visible <- function(code) {
  ret <- withVisible(code)
  expect_true(ret$visible)
  ret$value
}

connect <- function (drv) {
  connect_call <- as.call(c(list(quote(dbConnect), drv)))
  connect_fun <- function() {}
  body(connect_fun) <- connect_call
  connect_fun()
}
  expect_visible <- function(code) {
    ret <- withVisible(code)
    expect_true(ret$visible)
    ret$value
  }

context("r-lib dbi interface test")
  connect <- function (drv) {
    connect_call <- as.call(c(list(quote(dbConnect), drv)))
    connect_fun <- function() {}
    body(connect_fun) <- connect_call
    connect_fun()
  }

dr <- Drill()
  dr <- Drill()

expect_s4_class(dr, "DBIDriver")
expect_is(dbGetInfo(dr), "list")
expect_true(all(names(dbGetInfo(dr)) %in% c("driver.version", "client.version")))
  expect_true(inherits(dr, "DBIDriver"))
  expect_true(inherits(dbGetInfo(dr), "list"))
  expect_true(all(names(dbGetInfo(dr)) %in% c("driver.version", "client.version")))

expect_equal(names(formals(dbConnect)), c("drv", "..."))
expect_equal(names(formals(dbDisconnect)), c("conn", "..."))
  expect_equal(names(formals(dbConnect)), c("drv", "..."))
  expect_equal(names(formals(dbDisconnect)), c("conn", "..."))

con <- expect_visible(dbConnect(dr, test_host))
expect_s4_class(con, "DBIConnection")
expect_true(dbDisconnect(con))
  con <- expect_visible(dbConnect(dr, test_host))
  expect_true(inherits(con, "DBIConnection"))
  expect_true(dbDisconnect(con))

expect_is(dbGetInfo(con), "list")
  expect_true(inherits(dbGetInfo(con), "list"))

expect_is(format(con), "character")
  expect_true(inherits(format(con), "character"))

expect_equal(names(formals(dbDataType)), c("dbObj", "obj", "..."))
  expect_equal(names(formals(dbDataType)), c("dbObj", "obj", "..."))

expect_error(dbDataType(con, NULL))
  expect_error(dbDataType(con, NULL))

expect_identical(dbDataType(con, letters), dbDataType(con, factor(letters)))
expect_identical(dbDataType(con, letters), dbDataType(con, ordered(letters)))
  expect_identical(dbDataType(con, letters), dbDataType(con, factor(letters)))
  expect_identical(dbDataType(con, letters), dbDataType(con, ordered(letters)))

expect_true(
  all(c("db.version", "dbname", "username", "host", "port") %in% names(dbGetInfo(con)))
)
  expect_true(
    all(c("db.version", "dbname", "username", "host", "port") %in% names(dbGetInfo(con)))
  )

expect_false("password" %in% names(dbGetInfo(con)))
  expect_false("password" %in% names(dbGetInfo(con)))

expect_equal(names(formals(dbListFields)), c("conn", "name", "..."))
  expect_equal(names(formals(dbListFields)), c("conn", "name", "..."))

fields <- dbListFields(con, "cp.`employee.json`")
expect_is(fields, "character")
  fields <- dbListFields(con, "cp.`employee.json`")
  expect_true(inherits(fields, "character"))

expect_warning(dbListFields(con, "missing"))
  expect_warning(dbListFields(con, "missing"))

}

A inst/tinytest/test-rest-api.R => inst/tinytest/test-rest-api.R +67 -0
@@ 0,0 1,67 @@
test_host <- Sys.getenv("DRILL_TEST_HOST", "localhost")

options(sergeant.bigint.warnonce = FALSE)

if (at_home()) {

  dc <- drill_connection(test_host)
  expect_true(drill_active(dc))

  suppressMessages(
    drill_query(dc, "SELECT * FROM cp.`employee.json` limit 10", .progress = FALSE)
  ) -> test_rest

  expect_true(inherits(test_rest, "data.frame"))

  expect_true(inherits(drill_version(dc), "character"))
  expect_true(inherits(drill_metrics(dc), "list"))
  expect_true(inherits(drill_options(dc), "tbl"))

  dp <- drill_profiles(dc)

  expect_true(inherits(dp, "list"))

  expect_true(
    inherits(
      drill_profile(dc, dp$finishedQueries[1]$queryId[1]),
      "list"
    )
  )

  suppressMessages(
    expect_true(
      drill_cancel(dc, dp$finishedQueries[1]$queryId[1])
    )
  )

  suppressMessages(
    suppressWarnings(
      expect_true(
        inherits(
          drill_show_files(dc, schema_spec = "dfs"),
          "tbl"
        )
      )
    )
  )

  expect_true(inherits(drill_show_schemas(dc), "tbl"))
  expect_true(inherits(drill_storage(dc), "tbl"))
  expect_true(inherits(drill_stats(dc), "list"))
  expect_true(inherits(drill_status(dc), "html"))
  expect_true(inherits(drill_threads(dc), "html"))
  expect_true(inherits(drill_use(dc, "cp"), "tbl"))

  expect_true(
    inherits(
      drill_set(
        dc,
        exec.errors.verbose = TRUE,
        store.format = "parquet",
        web.logs.max_lines = 20000
      ),
      "tbl"
    )
  )

}

R tests/testthat/test-sergeant.R => inst/tinytest/test-sergeant.R +7 -17
@@ 5,44 5,34 @@ test_host <- Sys.getenv("DRILL_TEST_HOST", "localhost")

options(sergeant.bigint.warnonce = FALSE)

context("basic d[b]plyr API")
test_that("Core d[b]plyr ops work", {

  testthat::skip_on_cran()
if (at_home()) {

  db <- src_drill(test_host)

  expect_that(db, is_a("src_drill"))
  expect_true(inherits(db, "src_drill"))

  test_dplyr <- tbl(db, "cp.`employee.json`")

  expect_that(test_dplyr, is_a("tbl"))

})

context("extended d[b]plyr API")
test_that("Extended d[b]plyr ops work", {

  testthat::skip_on_cran()
  expect_true(inherits(test_dplyr, "tbl"))

  db <- src_drill(test_host)

  test_dplyr <- tbl(db, "cp.`employee.json`")

  expect_that(dplyr::count(test_dplyr, gender), is_a("tbl"))
  expect_true(inherits(dplyr::count(test_dplyr, gender), "tbl"))
  expect_true(sum(dplyr::collect(dplyr::count(test_dplyr, gender))[["n"]]) > 100)

  emp_partial <- tbl(db, sql("SELECT full_name from cp.`employee.json`"))
  expect_is(emp_partial, "tbl_drill")
  expect_true(inherits(emp_partial, "tbl_drill"))

  fields <- db_query_fields(emp_partial$src$con, sql("SELECT full_name from cp.`employee.json`"))
  expect_true(all(fields %in% c("full_name", "filename", "filepath", "fqn", "suffix")))
  expect_true(all(c("full_name", "filename", "filepath", "fqn", "suffix") %in% fields))

  expln <- db_explain(emp_partial$src$con, sql("SELECT full_name from cp.`employee.json`"))
  expect_true(grepl("groupscan", expln))

  res <- select(emp_partial, full_name)

})
}



M man/DrilDriver-class.Rd => man/DrilDriver-class.Rd +6 -5
@@ 1,6 1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dbi.r
\docType{methods}
\name{dbUnloadDriver,DrillDriver-method}
\alias{dbUnloadDriver,DrillDriver-method}
\title{Unload driver}


@@ 16,9 15,11 @@
Unload driver
}
\seealso{
Other Drill REST DBI API: \code{\link{DrillConnection-class}},
  \code{\link{DrillDriver-class}},
  \code{\link{DrillResult-class}}, \code{\link{Drill}},
  \code{\link{dbDataType,DrillConnection-method}}
Other Drill REST DBI API: 
\code{\link{DrillConnection-class}},
\code{\link{DrillDriver-class}},
\code{\link{DrillResult-class}},
\code{\link{Drill}()},
\code{\link{dbDataType,DrillConnection-method}}
}
\concept{Drill REST DBI API}

M man/Drill.Rd => man/Drill.Rd +22 -14
@@ 1,6 1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dbi.r
\docType{methods}
\name{Drill}
\alias{Drill}
\alias{dbConnect,DrillDriver-method}


@@ 8,8 7,15 @@
\usage{
Drill()

\S4method{dbConnect}{DrillDriver}(drv, host = "localhost",
  port = 8047L, ssl = FALSE, username = NULL, password = NULL, ...)
\S4method{dbConnect}{DrillDriver}(
  drv,
  host = "localhost",
  port = 8047L,
  ssl = FALSE,
  username = NULL,
  password = NULL,
  ...
)
}
\arguments{
\item{drv}{An object created by \code{Drill()}}


@@ 30,16 36,18 @@ Drill
Connect to Drill
}
\seealso{
Other Drill REST DBI API: \code{\link{DrillConnection-class}},
  \code{\link{DrillDriver-class}},
  \code{\link{DrillResult-class}},
  \code{\link{dbDataType,DrillConnection-method}},
  \code{\link{dbUnloadDriver,DrillDriver-method}}

Other Drill REST DBI API: \code{\link{DrillConnection-class}},
  \code{\link{DrillDriver-class}},
  \code{\link{DrillResult-class}},
  \code{\link{dbDataType,DrillConnection-method}},
  \code{\link{dbUnloadDriver,DrillDriver-method}}
Other Drill REST DBI API: 
\code{\link{DrillConnection-class}},
\code{\link{DrillDriver-class}},
\code{\link{DrillResult-class}},
\code{\link{dbDataType,DrillConnection-method}},
\code{\link{dbUnloadDriver,DrillDriver-method}}

Other Drill REST DBI API: 
\code{\link{DrillConnection-class}},
\code{\link{DrillDriver-class}},
\code{\link{DrillResult-class}},
\code{\link{dbDataType,DrillConnection-method}},
\code{\link{dbUnloadDriver,DrillDriver-method}}
}
\concept{Drill REST DBI API}

M man/DrillConnection-class.Rd => man/DrillConnection-class.Rd +18 -12
@@ 28,20 28,26 @@ Drill connection class.
Send a query to Drill
}
\seealso{
Other Drill REST DBI API: \code{\link{DrillDriver-class}},
  \code{\link{DrillResult-class}}, \code{\link{Drill}},
  \code{\link{dbDataType,DrillConnection-method}},
  \code{\link{dbUnloadDriver,DrillDriver-method}}
Other Drill REST DBI API: 
\code{\link{DrillDriver-class}},
\code{\link{DrillResult-class}},
\code{\link{Drill}()},
\code{\link{dbDataType,DrillConnection-method}},
\code{\link{dbUnloadDriver,DrillDriver-method}}

Other Drill REST DBI API: \code{\link{DrillDriver-class}},
  \code{\link{DrillResult-class}}, \code{\link{Drill}},
  \code{\link{dbDataType,DrillConnection-method}},
  \code{\link{dbUnloadDriver,DrillDriver-method}}
Other Drill REST DBI API: 
\code{\link{DrillDriver-class}},
\code{\link{DrillResult-class}},
\code{\link{Drill}()},
\code{\link{dbDataType,DrillConnection-method}},
\code{\link{dbUnloadDriver,DrillDriver-method}}

Other Drill REST DBI API: \code{\link{DrillDriver-class}},
  \code{\link{DrillResult-class}}, \code{\link{Drill}},
  \code{\link{dbDataType,DrillConnection-method}},
  \code{\link{dbUnloadDriver,DrillDriver-method}}
Other Drill REST DBI API: 
\code{\link{DrillDriver-class}},
\code{\link{DrillResult-class}},
\code{\link{Drill}()},
\code{\link{dbDataType,DrillConnection-method}},
\code{\link{dbUnloadDriver,DrillDriver-method}}
}
\concept{Drill REST DBI API}
\keyword{internal}

M man/DrillDriver-class.Rd => man/DrillDriver-class.Rd +6 -4
@@ 8,10 8,12 @@
Driver for Drill database.
}
\seealso{
Other Drill REST DBI API: \code{\link{DrillConnection-class}},
  \code{\link{DrillResult-class}}, \code{\link{Drill}},
  \code{\link{dbDataType,DrillConnection-method}},
  \code{\link{dbUnloadDriver,DrillDriver-method}}
Other Drill REST DBI API: 
\code{\link{DrillConnection-class}},
\code{\link{DrillResult-class}},
\code{\link{Drill}()},
\code{\link{dbDataType,DrillConnection-method}},
\code{\link{dbUnloadDriver,DrillDriver-method}}
}
\concept{Drill REST DBI API}
\keyword{internal}

M man/DrillResult-class.Rd => man/DrillResult-class.Rd +30 -20
@@ 35,30 35,40 @@ Completed
Statement
}
\seealso{
Other Drill REST DBI API: \code{\link{DrillConnection-class}},
  \code{\link{DrillDriver-class}}, \code{\link{Drill}},
  \code{\link{dbDataType,DrillConnection-method}},
  \code{\link{dbUnloadDriver,DrillDriver-method}}
Other Drill REST DBI API: 
\code{\link{DrillConnection-class}},
\code{\link{DrillDriver-class}},
\code{\link{Drill}()},
\code{\link{dbDataType,DrillConnection-method}},
\code{\link{dbUnloadDriver,DrillDriver-method}}

Other Drill REST DBI API: \code{\link{DrillConnection-class}},
  \code{\link{DrillDriver-class}}, \code{\link{Drill}},
  \code{\link{dbDataType,DrillConnection-method}},
  \code{\link{dbUnloadDriver,DrillDriver-method}}
Other Drill REST DBI API: 
\code{\link{DrillConnection-class}},
\code{\link{DrillDriver-class}},
\code{\link{Drill}()},
\code{\link{dbDataType,DrillConnection-method}},
\code{\link{dbUnloadDriver,DrillDriver-method}}

Other Drill REST DBI API: \code{\link{DrillConnection-class}},
  \code{\link{DrillDriver-class}}, \code{\link{Drill}},
  \code{\link{dbDataType,DrillConnection-method}},
  \code{\link{dbUnloadDriver,DrillDriver-method}}
Other Drill REST DBI API: 
\code{\link{DrillConnection-class}},
\code{\link{DrillDriver-class}},
\code{\link{Drill}()},
\code{\link{dbDataType,DrillConnection-method}},
\code{\link{dbUnloadDriver,DrillDriver-method}}

Other Drill REST DBI API: \code{\link{DrillConnection-class}},
  \code{\link{DrillDriver-class}}, \code{\link{Drill}},
  \code{\link{dbDataType,DrillConnection-method}},
  \code{\link{dbUnloadDriver,DrillDriver-method}}
Other Drill REST DBI API: 
\code{\link{DrillConnection-class}},
\code{\link{DrillDriver-class}},
\code{\link{Drill}()},
\code{\link{dbDataType,DrillConnection-method}},
\code{\link{dbUnloadDriver,DrillDriver-method}}

Other Drill REST DBI API: \code{\link{DrillConnection-class}},
  \code{\link{DrillDriver-class}}, \code{\link{Drill}},
  \code{\link{dbDataType,DrillConnection-method}},
  \code{\link{dbUnloadDriver,DrillDriver-method}}
Other Drill REST DBI API: 
\code{\link{DrillConnection-class}},
\code{\link{DrillDriver-class}},
\code{\link{Drill}()},
\code{\link{dbDataType,DrillConnection-method}},
\code{\link{dbUnloadDriver,DrillDriver-method}}
}
\concept{Drill REST DBI API}
\keyword{internal}

M man/ctas_profile.Rd => man/ctas_profile.Rd +1 -1
@@ 15,7 15,7 @@ ctas_profile(x, new_table_name = "CHANGE____ME")
When working with CSV[H] files in Drill 1.15.0+ everything comes back
\code{VARCHAR} since that's the way it should be. The old behaviour of
\code{sergeant} to auto-type convert was kinda horribad wrong. However,
it's a royal pain to make \href{https://drill.apache.org/docs/create-table-as-ctas/}{CTAS}
it's a royal pain to make \href{https://drill.apache.org/docs/create-table-as-ctas/}{\code{CTAS}}
queries from a giant list of \code{VARCHAR} field by hand. So, this is a
helper function to do that, inspired by David Severski.
}

M man/dbDataType-DrillConnection-method.Rd => man/dbDataType-DrillConnection-method.Rd +6 -5
@@ 1,6 1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dbi.r
\docType{methods}
\name{dbDataType,DrillConnection-method}
\alias{dbDataType,DrillConnection-method}
\title{Drill dbDataType}


@@ 18,9 17,11 @@
Drill dbDataType
}
\seealso{
Other Drill REST DBI API: \code{\link{DrillConnection-class}},
  \code{\link{DrillDriver-class}},
  \code{\link{DrillResult-class}}, \code{\link{Drill}},
  \code{\link{dbUnloadDriver,DrillDriver-method}}
Other Drill REST DBI API: 
\code{\link{DrillConnection-class}},
\code{\link{DrillDriver-class}},
\code{\link{DrillResult-class}},
\code{\link{Drill}()},
\code{\link{dbUnloadDriver,DrillDriver-method}}
}
\concept{Drill REST DBI API}

M man/dbDisconnect-DrillConnection-method.Rd => man/dbDisconnect-DrillConnection-method.Rd +0 -1
@@ 1,6 1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dbi.r
\docType{methods}
\name{dbDisconnect,DrillConnection-method}
\alias{dbDisconnect,DrillConnection-method}
\title{Disconnect from Drill}

M man/dbGetInfo.Rd => man/dbGetInfo.Rd +0 -1
@@ 1,6 1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dbi.r
\docType{methods}
\name{dbGetInfo,DrillDriver-method}
\alias{dbGetInfo,DrillDriver-method}
\alias{dbGetInfo,DrillConnection-method}

M man/drill_active.Rd => man/drill_active.Rd +18 -11
@@ 18,16 18,23 @@ drill_connection() \%>\% drill_active()
}, silent=TRUE)
}
\seealso{
Other Drill direct REST API Interface: \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},
  \code{\link{drill_opts}}, \code{\link{drill_profiles}},
  \code{\link{drill_profile}}, \code{\link{drill_query}},
  \code{\link{drill_settings_reset}},
  \code{\link{drill_set}}, \code{\link{drill_stats}},
  \code{\link{drill_status}}, \code{\link{drill_storage}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_threads}}, \code{\link{drill_version}}
Other Drill direct REST API Interface: 
\code{\link{drill_cancel}()},
\code{\link{drill_connection}()},
\code{\link{drill_functions}()},
\code{\link{drill_metrics}()},
\code{\link{drill_options}()},
\code{\link{drill_opts}()},
\code{\link{drill_profiles}()},
\code{\link{drill_profile}()},
\code{\link{drill_query}()},
\code{\link{drill_settings_reset}()},
\code{\link{drill_set}()},
\code{\link{drill_stats}()},
\code{\link{drill_status}()},
\code{\link{drill_storage}()},
\code{\link{drill_system_reset}()},
\code{\link{drill_threads}()},
\code{\link{drill_version}()}
}
\concept{Drill direct REST API Interface}

M man/drill_cancel.Rd => man/drill_cancel.Rd +18 -11
@@ 18,16 18,23 @@ Cancel the query that has the given queryid
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},
  \code{\link{drill_opts}}, \code{\link{drill_profiles}},
  \code{\link{drill_profile}}, \code{\link{drill_query}},
  \code{\link{drill_settings_reset}},
  \code{\link{drill_set}}, \code{\link{drill_stats}},
  \code{\link{drill_status}}, \code{\link{drill_storage}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_threads}}, \code{\link{drill_version}}
Other Drill direct REST API Interface: 
\code{\link{drill_active}()},
\code{\link{drill_connection}()},
\code{\link{drill_functions}()},
\code{\link{drill_metrics}()},
\code{\link{drill_options}()},
\code{\link{drill_opts}()},
\code{\link{drill_profiles}()},
\code{\link{drill_profile}()},
\code{\link{drill_query}()},
\code{\link{drill_settings_reset}()},
\code{\link{drill_set}()},
\code{\link{drill_stats}()},
\code{\link{drill_status}()},
\code{\link{drill_storage}()},
\code{\link{drill_system_reset}()},
\code{\link{drill_threads}()},
\code{\link{drill_version}()}
}
\concept{Drill direct REST API Interface}

M man/drill_connection.Rd => man/drill_connection.Rd +24 -14
@@ 4,10 4,13 @@
\alias{drill_connection}
\title{Setup a Drill connection}
\usage{
drill_connection(host = Sys.getenv("DRILL_HOST", "localhost"),
  port = Sys.getenv("DRILL_PORT", 8047), ssl = FALSE,
drill_connection(
  host = Sys.getenv("DRILL_HOST", "localhost"),
  port = Sys.getenv("DRILL_PORT", 8047),
  ssl = FALSE,
  user = Sys.getenv("DRILL_USER", ""),
  password = Sys.getenv("DRILL_PASSWORD", ""))
  password = Sys.getenv("DRILL_PASSWORD", "")
)
}
\arguments{
\item{host}{Drill host (will pick up the value from \code{DRILL_HOST} env var)}


@@ 29,16 32,23 @@ interface immediately to prime the cookie-jar with the session id.
dc <- drill_connection()
}
\seealso{
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},
  \code{\link{drill_opts}}, \code{\link{drill_profiles}},
  \code{\link{drill_profile}}, \code{\link{drill_query}},
  \code{\link{drill_settings_reset}},
  \code{\link{drill_set}}, \code{\link{drill_stats}},
  \code{\link{drill_status}}, \code{\link{drill_storage}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_threads}}, \code{\link{drill_version}}
Other Drill direct REST API Interface: 
\code{\link{drill_active}()},
\code{\link{drill_cancel}()},
\code{\link{drill_functions}()},
\code{\link{drill_metrics}()},
\code{\link{drill_options}()},
\code{\link{drill_opts}()},
\code{\link{drill_profiles}()},
\code{\link{drill_profile}()},
\code{\link{drill_query}()},
\code{\link{drill_settings_reset}()},
\code{\link{drill_set}()},
\code{\link{drill_stats}()},
\code{\link{drill_status}()},
\code{\link{drill_storage}()},
\code{\link{drill_system_reset}()},
\code{\link{drill_threads}()},
\code{\link{drill_version}()}
}
\concept{Drill direct REST API Interface}

M man/drill_custom_functions.Rd => man/drill_custom_functions.Rd +13 -12
@@ 21,12 21,12 @@ especially when you want to use parameters in a different order.
If you want a particular custom function mapped, file a PR or issue request in
the link found in the \code{DESCRIPTION} file.
\itemize{
\item \code{as.character(x)} : \code{CAST( x AS CHARACTER )}
\item \code{as.integer64(x)} : \code{CAST( x AS BIGINT )}
\item \code{as.date(x)} : \code{CAST( x AS DATE )}
\item \code{as.logical(x)} : \code{CAST( x AS BOOLEAN) }
\item \code{as.numeric(x)} : \code{CAST( x AS DOUBLE )}
\item \code{as.posixct(x)} : \code{CAST( x AS TIMESTAMP )}
\item \code{as.character(x)} : \verb{CAST( x AS CHARACTER )}
\item \code{as.integer64(x)} : \verb{CAST( x AS BIGINT )}
\item \code{as.date(x)} : \verb{CAST( x AS DATE )}
\item \code{as.logical(x)} : \verb{CAST( x AS BOOLEAN) }
\item \code{as.numeric(x)} : \verb{CAST( x AS DOUBLE )}
\item \code{as.posixct(x)} : \verb{CAST( x AS TIMESTAMP )}
\item \code{binary_string(x)} : \code{BINARY_STRING( x )}
\item \code{cbrt(x)} : \code{CBRT( x )}
\item \code{char_to_timestamp(x, y)} : \code{TO_TIMESTAMP( x, y )}


@@ 42,7 42,7 @@ the link found in the \code{DESCRIPTION} file.
\item \code{string_binary(x)} : \code{STRING_BINARY( x )}
\item \code{radians(x)} : \code{RADIANS( x )}
\item \code{rshift(x)} : \code{RSHIFT( x )}
\item \code{to_char(x, y)} : \code{TO_CHAR  x, y )}
\item \code{to_char(x, y)} : \verb{TO_CHAR  x, y )}
\item \code{to_date(x, y)} : \code{TO_DATE( x, y )}
\item \code{to_number(x, y)} : \code{TO_NUMBER( x, y )}
\item \code{trunc(x)} : \code{TRUNC( x )}


@@ 58,8 58,8 @@ the link found in the \code{DESCRIPTION} file.
\item \code{lower(x)} = \code{LOWER( x )}
\item \code{tolower(x)} = \code{LOWER( x )}
\item \code{ltrim(x, y)} = \code{LTRIM( x, y )}
\item \code{nullif(x, y} = \code{NULLIF( x, y )}
\item \code{position(x, y)} = \code{POSITION( x IN  y )}
\item \verb{nullif(x, y} = \code{NULLIF( x, y )}
\item \code{position(x, y)} = \verb{POSITION( x IN  y )}
\item \code{gsub(x, y, z)} = \code{REGEXP_REPLACE( z, x, y )}
\item \code{regexp_replace(x, y, z)} = \code{REGEXP_REPLACE( x, y, z )}
\item \code{rtrim(x, y)} = \code{RTRIM( x, y )}


@@ 80,7 80,8 @@ You can get a compact list of these with:
as well.
}
\seealso{
Other Drill REST `dplyr` API: \code{\link{src_drill}},
  \code{\link{src_tbls.src_drill}}
Other Drill REST \code{dplyr} API: 
\code{\link{src_drill}()},
\code{\link{src_tbls.src_drill}()}
}
\concept{Drill REST `dplyr` API}
\concept{Drill REST \code{dplyr} API}

M man/drill_functions.Rd => man/drill_functions.Rd +18 -11
@@ 30,16 30,23 @@ drill_connection() \%>\% drill_functions()
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},
  \code{\link{drill_opts}}, \code{\link{drill_profiles}},
  \code{\link{drill_profile}}, \code{\link{drill_query}},
  \code{\link{drill_settings_reset}},
  \code{\link{drill_set}}, \code{\link{drill_stats}},
  \code{\link{drill_status}}, \code{\link{drill_storage}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_threads}}, \code{\link{drill_version}}
Other Drill direct REST API Interface: 
\code{\link{drill_active}()},
\code{\link{drill_cancel}()},
\code{\link{drill_connection}()},
\code{\link{drill_metrics}()},
\code{\link{drill_options}()},
\code{\link{drill_opts}()},
\code{\link{drill_profiles}()},
\code{\link{drill_profile}()},
\code{\link{drill_query}()},
\code{\link{drill_settings_reset}()},
\code{\link{drill_set}()},
\code{\link{drill_stats}()},
\code{\link{drill_status}()},
\code{\link{drill_storage}()},
\code{\link{drill_system_reset}()},
\code{\link{drill_threads}()},
\code{\link{drill_version}()}
}
\concept{Drill direct REST API Interface}

M man/drill_metrics.Rd => man/drill_metrics.Rd +18 -12
@@ 18,17 18,23 @@ drill_connection() \%>\% drill_metrics()
}
}
\seealso{
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},
  \code{\link{drill_options}}, \code{\link{drill_opts}},
  \code{\link{drill_profiles}},
  \code{\link{drill_profile}}, \code{\link{drill_query}},
  \code{\link{drill_settings_reset}},
  \code{\link{drill_set}}, \code{\link{drill_stats}},
  \code{\link{drill_status}}, \code{\link{drill_storage}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_threads}}, \code{\link{drill_version}}
Other Drill direct REST API Interface: 
\code{\link{drill_active}()},
\code{\link{drill_cancel}()},
\code{\link{drill_connection}()},
\code{\link{drill_functions}()},
\code{\link{drill_options}()},
\code{\link{drill_opts}()},
\code{\link{drill_profiles}()},
\code{\link{drill_profile}()},
\code{\link{drill_query}()},
\code{\link{drill_settings_reset}()},
\code{\link{drill_set}()},
\code{\link{drill_stats}()},
\code{\link{drill_status}()},
\code{\link{drill_storage}()},
\code{\link{drill_system_reset}()},
\code{\link{drill_threads}()},
\code{\link{drill_version}()}
}
\concept{Drill direct REST API Interface}

M man/drill_options.Rd => man/drill_options.Rd +18 -12
@@ 23,17 23,23 @@ drill_connection() \%>\% drill_options()
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_opts}},
  \code{\link{drill_profiles}},
  \code{\link{drill_profile}}, \code{\link{drill_query}},
  \code{\link{drill_settings_reset}},
  \code{\link{drill_set}}, \code{\link{drill_stats}},
  \code{\link{drill_status}}, \code{\link{drill_storage}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_threads}}, \code{\link{drill_version}}
Other Drill direct REST API Interface: 
\code{\link{drill_active}()},
\code{\link{drill_cancel}()},
\code{\link{drill_connection}()},
\code{\link{drill_functions}()},
\code{\link{drill_metrics}()},
\code{\link{drill_opts}()},
\code{\link{drill_profiles}()},
\code{\link{drill_profile}()},
\code{\link{drill_query}()},
\code{\link{drill_settings_reset}()},
\code{\link{drill_set}()},
\code{\link{drill_stats}()},
\code{\link{drill_status}()},
\code{\link{drill_storage}()},
\code{\link{drill_system_reset}()},
\code{\link{drill_threads}()},
\code{\link{drill_version}()}
}
\concept{Drill direct REST API Interface}

M man/drill_opts.Rd => man/drill_opts.Rd +18 -12
@@ 30,17 30,23 @@ drill_connection() \%>\% drill_opts()
\href{https://drill.apache.org/docs/querying-system-tables/#querying-the-options-table}{Drill documentation}
}
\seealso{
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},
  \code{\link{drill_profiles}},
  \code{\link{drill_profile}}, \code{\link{drill_query}},
  \code{\link{drill_settings_reset}},
  \code{\link{drill_set}}, \code{\link{drill_stats}},
  \code{\link{drill_status}}, \code{\link{drill_storage}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_threads}}, \code{\link{drill_version}}
Other Drill direct REST API Interface: 
\code{\link{drill_active}()},
\code{\link{drill_cancel}()},
\code{\link{drill_connection}()},
\code{\link{drill_functions}()},
\code{\link{drill_metrics}()},
\code{\link{drill_options}()},
\code{\link{drill_profiles}()},
\code{\link{drill_profile}()},
\code{\link{drill_query}()},
\code{\link{drill_settings_reset}()},
\code{\link{drill_set}()},
\code{\link{drill_stats}()},
\code{\link{drill_status}()},
\code{\link{drill_storage}()},
\code{\link{drill_system_reset}()},
\code{\link{drill_threads}()},
\code{\link{drill_version}()}
}
\concept{Drill direct REST API Interface}

M man/drill_profile.Rd => man/drill_profile.Rd +18 -12
@@ 18,17 18,23 @@ Get the profile of the query that has the given queryid
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},
  \code{\link{drill_opts}}, \code{\link{drill_profiles}},
  \code{\link{drill_query}},
  \code{\link{drill_settings_reset}},
  \code{\link{drill_set}}, \code{\link{drill_stats}},
  \code{\link{drill_status}}, \code{\link{drill_storage}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_threads}}, \code{\link{drill_version}}
Other Drill direct REST API Interface: 
\code{\link{drill_active}()},
\code{\link{drill_cancel}()},
\code{\link{drill_connection}()},
\code{\link{drill_functions}()},
\code{\link{drill_metrics}()},
\code{\link{drill_options}()},
\code{\link{drill_opts}()},
\code{\link{drill_profiles}()},
\code{\link{drill_query}()},
\code{\link{drill_settings_reset}()},
\code{\link{drill_set}()},
\code{\link{drill_stats}()},
\code{\link{drill_status}()},
\code{\link{drill_storage}()},
\code{\link{drill_system_reset}()},
\code{\link{drill_threads}()},
\code{\link{drill_version}()}
}
\concept{Drill direct REST API Interface}

M man/drill_profiles.Rd => man/drill_profiles.Rd +18 -12
@@ 21,17 21,23 @@ drill_connection() \%>\% drill_profiles()
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},
  \code{\link{drill_opts}}, \code{\link{drill_profile}},
  \code{\link{drill_query}},
  \code{\link{drill_settings_reset}},
  \code{\link{drill_set}}, \code{\link{drill_stats}},
  \code{\link{drill_status}}, \code{\link{drill_storage}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_threads}}, \code{\link{drill_version}}
Other Drill direct REST API Interface: 
\code{\link{drill_active}()},
\code{\link{drill_cancel}()},
\code{\link{drill_connection}()},
\code{\link{drill_functions}()},
\code{\link{drill_metrics}()},
\code{\link{drill_options}()},
\code{\link{drill_opts}()},
\code{\link{drill_profile}()},
\code{\link{drill_query}()},
\code{\link{drill_settings_reset}()},
\code{\link{drill_set}()},
\code{\link{drill_stats}()},
\code{\link{drill_status}()},
\code{\link{drill_storage}()},
\code{\link{drill_system_reset}()},
\code{\link{drill_threads}()},
\code{\link{drill_version}()}
}
\concept{Drill direct REST API Interface}

M man/drill_query.Rd => man/drill_query.Rd +18 -12
@@ 36,17 36,23 @@ drill_connection() \%>\%
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},
  \code{\link{drill_opts}}, \code{\link{drill_profiles}},
  \code{\link{drill_profile}},
  \code{\link{drill_settings_reset}},
  \code{\link{drill_set}}, \code{\link{drill_stats}},
  \code{\link{drill_status}}, \code{\link{drill_storage}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_threads}}, \code{\link{drill_version}}
Other Drill direct REST API Interface: 
\code{\link{drill_active}()},
\code{\link{drill_cancel}()},
\code{\link{drill_connection}()},
\code{\link{drill_functions}()},
\code{\link{drill_metrics}()},
\code{\link{drill_options}()},
\code{\link{drill_opts}()},
\code{\link{drill_profiles}()},
\code{\link{drill_profile}()},
\code{\link{drill_settings_reset}()},
\code{\link{drill_set}()},
\code{\link{drill_stats}()},
\code{\link{drill_status}()},
\code{\link{drill_storage}()},
\code{\link{drill_system_reset}()},
\code{\link{drill_threads}()},
\code{\link{drill_version}()}
}
\concept{Drill direct REST API Interface}

M man/drill_set.Rd => man/drill_set.Rd +19 -13
@@ 9,7 9,7 @@ drill_set(drill_con, ..., type = c("session", "system"))
\arguments{
\item{drill_con}{drill server connection object setup by \code{drill_connection()}}

\item{...}{named parameters to be sent to \code{ALTER SYSTEM} or \code{ALTER SESSION}}
\item{...}{named parameters to be sent to \verb{ALTER SYSTEM} or \verb{ALTER SESSION}}

\item{type}{set the \code{session} or \code{system} parameter}
}


@@ 34,17 34,23 @@ drill_connection() \%>\%
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},
  \code{\link{drill_opts}}, \code{\link{drill_profiles}},
  \code{\link{drill_profile}}, \code{\link{drill_query}},
  \code{\link{drill_settings_reset}},
  \code{\link{drill_stats}}, \code{\link{drill_status}},
  \code{\link{drill_storage}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_threads}}, \code{\link{drill_version}}
Other Drill direct REST API Interface: 
\code{\link{drill_active}()},
\code{\link{drill_cancel}()},
\code{\link{drill_connection}()},
\code{\link{drill_functions}()},
\code{\link{drill_metrics}()},
\code{\link{drill_options}()},
\code{\link{drill_opts}()},
\code{\link{drill_profiles}()},
\code{\link{drill_profile}()},
\code{\link{drill_query}()},
\code{\link{drill_settings_reset}()},
\code{\link{drill_stats}()},
\code{\link{drill_status}()},
\code{\link{drill_storage}()},
\code{\link{drill_system_reset}()},
\code{\link{drill_threads}()},
\code{\link{drill_version}()}
}
\concept{Drill direct REST API Interface}

M man/drill_settings_reset.Rd => man/drill_settings_reset.Rd +18 -11
@@ 23,16 23,23 @@ drill_connection() \%>\% drill_settings_reset(exec.errors.verbose)
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},
  \code{\link{drill_opts}}, \code{\link{drill_profiles}},
  \code{\link{drill_profile}}, \code{\link{drill_query}},
  \code{\link{drill_set}}, \code{\link{drill_stats}},
  \code{\link{drill_status}}, \code{\link{drill_storage}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_threads}}, \code{\link{drill_version}}
Other Drill direct REST API Interface: 
\code{\link{drill_active}()},
\code{\link{drill_cancel}()},
\code{\link{drill_connection}()},
\code{\link{drill_functions}()},
\code{\link{drill_metrics}()},
\code{\link{drill_options}()},
\code{\link{drill_opts}()},
\code{\link{drill_profiles}()},
\code{\link{drill_profile}()},
\code{\link{drill_query}()},
\code{\link{drill_set}()},
\code{\link{drill_stats}()},
\code{\link{drill_status}()},
\code{\link{drill_storage}()},
\code{\link{drill_system_reset}()},
\code{\link{drill_threads}()},
\code{\link{drill_version}()}
}
\concept{Drill direct REST API Interface}

M man/drill_show_files.Rd => man/drill_show_files.Rd +3 -2
@@ 26,7 26,8 @@ drill_connection() \%>\% drill_show_files("dfs.tmp")
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_show_schemas}},
  \code{\link{drill_use}}
Other Dill direct REST API Interface: 
\code{\link{drill_show_schemas}()},
\code{\link{drill_use}()}
}
\concept{Dill direct REST API Interface}

M man/drill_show_schemas.Rd => man/drill_show_schemas.Rd +3 -2
@@ 19,7 19,8 @@ Returns a list of available schemas.
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_show_files}},
  \code{\link{drill_use}}
Other Dill direct REST API Interface: 
\code{\link{drill_show_files}()},
\code{\link{drill_use}()}
}
\concept{Dill direct REST API Interface}

M man/drill_stats.Rd => man/drill_stats.Rd +18 -12
@@ 21,17 21,23 @@ drill_connection() \%>\% drill_stats()
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},
  \code{\link{drill_opts}}, \code{\link{drill_profiles}},
  \code{\link{drill_profile}}, \code{\link{drill_query}},
  \code{\link{drill_settings_reset}},
  \code{\link{drill_set}}, \code{\link{drill_status}},
  \code{\link{drill_storage}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_threads}}, \code{\link{drill_version}}
Other Drill direct REST API Interface: 
\code{\link{drill_active}()},
\code{\link{drill_cancel}()},
\code{\link{drill_connection}()},
\code{\link{drill_functions}()},
\code{\link{drill_metrics}()},
\code{\link{drill_options}()},
\code{\link{drill_opts}()},
\code{\link{drill_profiles}()},
\code{\link{drill_profile}()},
\code{\link{drill_query}()},
\code{\link{drill_settings_reset}()},
\code{\link{drill_set}()},
\code{\link{drill_status}()},
\code{\link{drill_storage}()},
\code{\link{drill_system_reset}()},
\code{\link{drill_threads}()},
\code{\link{drill_version}()}
}
\concept{Drill direct REST API Interface}

M man/drill_status.Rd => man/drill_status.Rd +18 -12
@@ 21,17 21,23 @@ drill_connection() \%>\% drill_status()
}
}
\seealso{
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},
  \code{\link{drill_opts}}, \code{\link{drill_profiles}},
  \code{\link{drill_profile}}, \code{\link{drill_query}},
  \code{\link{drill_settings_reset}},
  \code{\link{drill_set}}, \code{\link{drill_stats}},
  \code{\link{drill_storage}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_threads}}, \code{\link{drill_version}}
Other Drill direct REST API Interface: 
\code{\link{drill_active}()},
\code{\link{drill_cancel}()},
\code{\link{drill_connection}()},
\code{\link{drill_functions}()},
\code{\link{drill_metrics}()},
\code{\link{drill_options}()},
\code{\link{drill_opts}()},
\code{\link{drill_profiles}()},
\code{\link{drill_profile}()},
\code{\link{drill_query}()},
\code{\link{drill_settings_reset}()},
\code{\link{drill_set}()},
\code{\link{drill_stats}()},
\code{\link{drill_storage}()},
\code{\link{drill_system_reset}()},
\code{\link{drill_threads}()},
\code{\link{drill_version}()}
}
\concept{Drill direct REST API Interface}

M man/drill_storage.Rd => man/drill_storage.Rd +18 -12
@@ 62,17 62,23 @@ drill_connection() \%>\%
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},
  \code{\link{drill_opts}}, \code{\link{drill_profiles}},
  \code{\link{drill_profile}}, \code{\link{drill_query}},
  \code{\link{drill_settings_reset}},
  \code{\link{drill_set}}, \code{\link{drill_stats}},
  \code{\link{drill_status}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_threads}}, \code{\link{drill_version}}
Other Drill direct REST API Interface: 
\code{\link{drill_active}()},
\code{\link{drill_cancel}()},
\code{\link{drill_connection}()},
\code{\link{drill_functions}()},
\code{\link{drill_metrics}()},
\code{\link{drill_options}()},
\code{\link{drill_opts}()},
\code{\link{drill_profiles}()},
\code{\link{drill_profile}()},
\code{\link{drill_query}()},
\code{\link{drill_settings_reset}()},
\code{\link{drill_set}()},
\code{\link{drill_stats}()},
\code{\link{drill_status}()},
\code{\link{drill_system_reset}()},
\code{\link{drill_threads}()},
\code{\link{drill_version}()}
}
\concept{Drill direct REST API Interface}

M man/drill_system_reset.Rd => man/drill_system_reset.Rd +18 -11
@@ 25,16 25,23 @@ drill_connection() \%>\% drill_system_reset(all=TRUE)
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},
  \code{\link{drill_opts}}, \code{\link{drill_profiles}},
  \code{\link{drill_profile}}, \code{\link{drill_query}},
  \code{\link{drill_settings_reset}},
  \code{\link{drill_set}}, \code{\link{drill_stats}},
  \code{\link{drill_status}}, \code{\link{drill_storage}},
  \code{\link{drill_threads}}, \code{\link{drill_version}}
Other Drill direct REST API Interface: 
\code{\link{drill_active}()},
\code{\link{drill_cancel}()},
\code{\link{drill_connection}()},
\code{\link{drill_functions}()},
\code{\link{drill_metrics}()},
\code{\link{drill_options}()},
\code{\link{drill_opts}()},
\code{\link{drill_profiles}()},
\code{\link{drill_profile}()},
\code{\link{drill_query}()},
\code{\link{drill_settings_reset}()},
\code{\link{drill_set}()},
\code{\link{drill_stats}()},
\code{\link{drill_status}()},
\code{\link{drill_storage}()},
\code{\link{drill_threads}()},
\code{\link{drill_version}()}
}
\concept{Drill direct REST API Interface}

M man/drill_threads.Rd => man/drill_threads.Rd +18 -12
@@ 21,17 21,23 @@ drill_connection() \%>\% drill_threads()
}
}
\seealso{
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},
  \code{\link{drill_opts}}, \code{\link{drill_profiles}},
  \code{\link{drill_profile}}, \code{\link{drill_query}},
  \code{\link{drill_settings_reset}},
  \code{\link{drill_set}}, \code{\link{drill_stats}},
  \code{\link{drill_status}}, \code{\link{drill_storage}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_version}}
Other Drill direct REST API Interface: 
\code{\link{drill_active}()},
\code{\link{drill_cancel}()},
\code{\link{drill_connection}()},
\code{\link{drill_functions}()},
\code{\link{drill_metrics}()},
\code{\link{drill_options}()},
\code{\link{drill_opts}()},
\code{\link{drill_profiles}()},
\code{\link{drill_profile}()},
\code{\link{drill_query}()},
\code{\link{drill_settings_reset}()},
\code{\link{drill_set}()},
\code{\link{drill_stats}()},
\code{\link{drill_status}()},
\code{\link{drill_storage}()},
\code{\link{drill_system_reset}()},
\code{\link{drill_version}()}
}
\concept{Drill direct REST API Interface}

M man/drill_up.Rd => man/drill_up.Rd +14 -9
@@ 5,8 5,12 @@
\alias{drill_down}
\title{Start a Dockerized Drill Instance}
\usage{
drill_up(image = "drill/apache-drill:1.16.0", container_name = "drill",
  data_dir = getwd(), remove = TRUE)
drill_up(
  image = "drill/apache-drill:1.16.0",
  container_name = "drill",
  data_dir = getwd(),
  remove = TRUE
)

drill_down(id)
}


@@ 18,7 22,7 @@ to most recent Drill docker image.}
\item{container_name}{naem for the container. Defaults to "\code{drill}".}

\item{data_dir}{valid path to a place where your data is stored; defaults to the
value of \code{\link[=getwd]{getwd()}}. This will be \code{\link[=path.expand]{path.expand()}}ed and mapped to \code{/data}
value of \code{\link[=getwd]{getwd()}}. This will be \code{\link[=path.expand]{path.expand()}}ed and mapped to \verb{/data}
in the container. This will be mapped to the \code{dfs} storage plugin as the
\code{dfs.d} workspace.}



@@ 29,7 33,7 @@ Defaults to \code{TRUE} since you shouldn't be relying on this in production.}
}
\value{
a \code{stevedore} docker object (invisibly) which \emph{you} are responsible
for killing with the \code{$stop()}  function or from the Docker command
for killing with the \verb{$stop()}  function or from the Docker command
line (in interactive mode the docker container ID is printed as well).
}
\description{


@@ 40,15 44,15 @@ one at \href{https://hub.docker.com/u/drill}{Drill's Docker Hub}.
}
\details{
The path specified in \code{data_dir} will be mapped inside the container as
\code{/data} and a new \code{dfs} storage workspace will created (\code{dfs.d}) that
maps to \code{/data} and is writable.
\verb{/data} and a new \code{dfs} storage workspace will created (\code{dfs.d}) that
maps to \verb{/data} and is writable.

Use \code{\link[=drill_down]{drill_down()}} to stop a running Drill container by container id
(full or partial).
}
\note{
this requires a working Docker setup on your system and it is \emph{highly suggested}
you \code{docker pull} it yourself before running this function.
you \verb{docker pull} it yourself before running this function.
}
\examples{
\dontrun{


@@ 56,7 60,8 @@ drill_up(data_dir = "~/Data")
}
}
\seealso{
Other Drill Docker functions: \code{\link{killall_drill}},
  \code{\link{showall_drill}}
Other Drill Docker functions: 
\code{\link{killall_drill}()},
\code{\link{showall_drill}()}
}
\concept{Drill Docker functions}

M man/drill_use.Rd => man/drill_use.Rd +3 -2
@@ 22,7 22,8 @@ Change to a particular schema.
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_show_files}},
  \code{\link{drill_show_schemas}}
Other Dill direct REST API Interface: 
\code{\link{drill_show_files}()},
\code{\link{drill_show_schemas}()}
}
\concept{Dill direct REST API Interface}

M man/drill_version.Rd => man/drill_version.Rd +18 -12
@@ 21,17 21,23 @@ drill_connection() \%>\% drill_version()
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},
  \code{\link{drill_opts}}, \code{\link{drill_profiles}},
  \code{\link{drill_profile}}, \code{\link{drill_query}},
  \code{\link{drill_settings_reset}},
  \code{\link{drill_set}}, \code{\link{drill_stats}},
  \code{\link{drill_status}}, \code{\link{drill_storage}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_threads}}
Other Drill direct REST API Interface: 
\code{\link{drill_active}()},
\code{\link{drill_cancel}()},
\code{\link{drill_connection}()},
\code{\link{drill_functions}()},
\code{\link{drill_metrics}()},
\code{\link{drill_options}()},
\code{\link{drill_opts}()},
\code{\link{drill_profiles}()},
\code{\link{drill_profile}()},
\code{\link{drill_query}()},
\code{\link{drill_settings_reset}()},
\code{\link{drill_set}()},
\code{\link{drill_stats}()},
\code{\link{drill_status}()},
\code{\link{drill_storage}()},
\code{\link{drill_system_reset}()},
\code{\link{drill_threads}()}
}
\concept{Drill direct REST API Interface}

M man/killall_drill.Rd => man/killall_drill.Rd +3 -2
@@ 15,7 15,8 @@ You may want to consider using the Docker command-line interface to perform
this work manually.
}
\seealso{
Other Drill Docker functions: \code{\link{drill_up}},
  \code{\link{showall_drill}}
Other Drill Docker functions: 
\code{\link{drill_up}()},
\code{\link{showall_drill}()}
}
\concept{Drill Docker functions}

M man/sergeant.Rd => man/sergeant.Rd +0 -1
@@ 3,7 3,6 @@
\docType{package}
\name{sergeant}
\alias{sergeant}
\alias{sergeant-package}
\title{Tools to Transform and Query Data with 'Apache' 'Drill'}
\description{
Drill is an innovative low-latency distributed query engine designed to enable data

M man/showall_drill.Rd => man/showall_drill.Rd +3 -2
@@ 11,7 11,8 @@ This function will show \emph{all} Docker containers that are based on an
image matching a runtime command of "\code{bin/drill-embedded}".
}
\seealso{
Other Drill Docker functions: \code{\link{drill_up}},
  \code{\link{killall_drill}}
Other Drill Docker functions: 
\code{\link{drill_up}()},
\code{\link{killall_drill}()}
}
\concept{Drill Docker functions}

M man/src_drill.Rd => man/src_drill.Rd +14 -8
@@ 5,9 5,13 @@
\alias{tbl.src_drill}
\title{Connect to Drill (dplyr)}
\usage{
src_drill(host = Sys.getenv("DRILL_HOST", "localhost"),
  port = as.integer(Sys.getenv("DRILL_PORT", 8047L)), ssl = FALSE,
  username = NULL, password = NULL)
src_drill(
  host = Sys.getenv("DRILL_HOST", "localhost"),
  port = as.integer(Sys.getenv("DRILL_PORT", 8047L)),
  ssl = FALSE,
  username = NULL,
  password = NULL
)

\method{tbl}{src_drill}(src, from, ...)
}


@@ 83,10 87,12 @@ select(emp, full_name) \%>\%
}, silent=TRUE)
}
\seealso{
Other Drill REST `dplyr` API: \code{\link{drill_custom_functions}},
  \code{\link{src_tbls.src_drill}}
Other Drill REST \code{dplyr} API: 
\code{\link{drill_custom_functions}},
\code{\link{src_tbls.src_drill}()}

Other Drill REST `dplyr` API: \code{\link{drill_custom_functions}},
  \code{\link{src_tbls.src_drill}}
Other Drill REST \code{dplyr} API: 
\code{\link{drill_custom_functions}},
\code{\link{src_tbls.src_drill}()}
}
\concept{Drill REST `dplyr` API}
\concept{Drill REST \code{dplyr} API}

M man/src_tbls.Rd => man/src_tbls.Rd +7 -4
@@ 11,7 11,7 @@
\alias{sql_translate_env.DrillConnection}
\title{src tbls}
\usage{
\method{src_tbls}{src_drill}(x)
\method{src_tbls}{src_drill}(x, ...)

\method{db_desc}{src_drill}(x)



@@ 29,13 29,16 @@
}
\arguments{
\item{x}{x}

\item{...}{ignored}
}
\description{
"SHOW DATABASES"
}
\seealso{
Other Drill REST `dplyr` API: \code{\link{drill_custom_functions}},
  \code{\link{src_drill}}
Other Drill REST \code{dplyr} API: 
\code{\link{drill_custom_functions}},
\code{\link{src_drill}()}
}
\concept{Drill REST `dplyr` API}
\concept{Drill REST \code{dplyr} API}
\keyword{internal}

D tests/testthat.R => tests/testthat.R +0 -5
@@ 1,5 0,0 @@
library(dbplyr)
library(sergeant)
library(testthat)

test_check("sergeant")

D tests/testthat/test-rest-api.R => tests/testthat/test-rest-api.R +0 -50
@@ 1,50 0,0 @@
test_host <- Sys.getenv("DRILL_TEST_HOST", "localhost")

options(sergeant.bigint.warnonce = FALSE)

context("REST API")
test_that("REST API works", {

  testthat::skip_on_cran()

  dc <- drill_connection(test_host)
  expect_that(drill_active(dc), equals(TRUE))

  suppressMessages(
    drill_query(dc, "SELECT * FROM cp.`employee.json` limit 10", .progress = FALSE)
  ) -> test_rest

  expect_that(test_rest, is_a("data.frame"))

  expect_that(drill_version(dc), is_a("character"))
  expect_that(drill_metrics(dc), is_a("list"))
  expect_that(drill_options(dc), is_a("tbl"))

  dp <- drill_profiles(dc)

  expect_that(dp, is_a("list"))
  expect_that(drill_profile(dc, dp$finishedQueries[1]$queryId[1]), is_a("list"))
  suppressMessages(
    expect_that(drill_cancel(dc, dp$finishedQueries[1]$queryId[1]), equals(TRUE))
  )
  suppressMessages(
    suppressWarnings(
      expect_that(drill_show_files(dc, schema_spec = "dfs"), is_a("tbl"))
    )
  )
  expect_that(drill_show_schemas(dc), is_a("tbl"))
  expect_that(drill_storage(dc), is_a("tbl"))
  expect_that(drill_stats(dc), is_a("list"))
  expect_that(drill_status(dc), is_a("html"))
  expect_that(drill_threads(dc), is_a("html"))
  expect_that(drill_use(dc, "cp"), is_a("tbl"))
  expect_that(
    drill_set(
      dc,
      exec.errors.verbose=TRUE,
      store.format="parquet",
      web.logs.max_lines=20000),
    is_a("tbl")
  )

})

A tests/tinytest.R => tests/tinytest.R +5 -0
@@ 0,0 1,5 @@

if ( requireNamespace("tinytest", quietly=TRUE) ){
  tinytest::test_package("sergeant")
}