M .travis.yml => .travis.yml +2 -2
@@ 18,8 18,8 @@ addons:
- oracle-java8-set-default
before_install:
- - docker pull drill/apache-drill:1.15.0
- - docker run -i --name drill-1.15.0 -p 8047:8047 --detach -t drill/apache-drill:1.15.0 /bin/bash
+ - docker pull drill/apache-drill:1.16.0
+ - docker run -i --name drill-1.16.0 -p 8047:8047 --detach -t drill/apache-drill:1.16.0 /bin/bash
- docker ps -a
before_script:
M DESCRIPTION => DESCRIPTION +1 -0
@@ 6,6 6,7 @@ Authors@R: c(
comment = c(ORCID = "0000-0001-5670-2640")),
person("Edward", "Visel", email = "edward.visel@gmail.com", role = "ctb"),
person("Andy", "Hine", email = "andyyhine@gmail.com", role = "ctb"),
+ person("Scott", "Came", email = "scottcame10@gmail.com", role = "ctb"),
person("David", "Severski", email = "davidski@deadheaven.com", role = "ctb",
comment = c(ORCID = "https://orcid.org/0000-0001-7867-0459"))
)
M R/aaa.r => R/aaa.r +0 -1
@@ 8,4 8,3 @@ make_server <- function(drill_con) {
drill_con$host, drill_con$port)
}
-#
M R/ctas-profile.R => R/ctas-profile.R +1 -1
@@ 1,6 1,6 @@
#' Generate a Drill CTAS Statement from a Query
#'
-#' When working with CSV\[H] files in Drill 1.15.0+ everyting comes back
+#' When working with CSV\[H] files in Drill 1.15.0+ everything comes back
#' `VARCHAR` since that's the way it should be. The old behaviour of
#' `sergeant` to auto-type convert was kinda horribad wrong. However,
#' it's a royal pain to make [`CTAS`](https://drill.apache.org/docs/create-table-as-ctas/)
M R/dbi.r => R/dbi.r +5 -1
@@ 220,7 220,8 @@ setMethod(
warning(resp, call.=FALSE)
- return(dplyr::data_frame())
+ xdf <- dplyr::tibble()
+ return(xdf)
} else {
@@ 272,6 273,9 @@ setMethod(
class(xdf) <- c("data.frame")
return(xdf)
}
+ } else {
+ xdf <- dplyr::tibble()
+ return(xdf)
}
# ** only available in Drill 1.15.0+ **
M R/dplyr.r => R/dplyr.r +48 -48
@@ 105,7 105,7 @@ db_desc.src_drill <- function(x) {
#' @keywords internal
#' @export
sql_escape_ident.DrillConnection <- function(con, x) {
- ifelse(grepl("`", x), sql_quote(x, ' '), sql_quote(x, '`'))
+ ifelse(grepl("`", x), dbplyr::sql_quote(x, ' '), dbplyr::sql_quote(x, '`'))
}
#' @rdname src_tbls
@@ 129,7 129,7 @@ tbl.src_drill <- function(src, from, ...) {
#' @keywords internal
#' @export
db_explain.DrillConnection <- function(con, sql, ...) {
- explain_sql <- dbplyr::build_sql("EXPLAIN PLAN FOR ", sql)
+ explain_sql <- dbplyr::build_sql("EXPLAIN PLAN FOR ", sql, con = con)
explanation <- dbGetQuery(con, explain_sql)
return(paste(explanation[[1]], collapse = "\n"))
}
@@ 194,56 194,56 @@ sql_translate_env.DrillConnection <- function(con) {
grepl = function(x, y) build_sql("CONTAINS(", y, ", ", x, ")"),
gsub = function(x, y, z) build_sql("REGEXP_REPLACE(", z, ", ", x, ",", y ,")"),
trimws = function(x) build_sql("TRIM(both ' ' FROM ", x, ")"),
- cbrt = sql_prefix("CBRT", 1),
- degrees = sql_prefix("DEGREES", 1),
+ cbrt = dbplyr::sql_prefix("CBRT", 1),
+ degrees = dbplyr::sql_prefix("DEGREES", 1),
as_interval = function(x, y) build_sql("CAST(", x, " AS INTERVAL ", sql(toupper(y)), ")"),
- e = sql_prefix("E", 0),
+ e = dbplyr::sql_prefix("E", 0),
cast = function(x, y) build_sql("CAST(", x, " AS ", sql(y), ")"),
- row_number = sql_prefix("row_number", 0),
- lshift = sql_prefix("LSHIFT", 2),
- mod = sql_prefix("MOD", 2),
- age = sql_prefix("AGE", 1),
- negative = sql_prefix("NEGATIVE", 1),
- pi = sql_prefix("PI", 0),
- pow = sql_prefix("POW", 2),
- radians = sql_prefix("RADIANS", 1),
- rand = sql_prefix("RAND", 0),
- rshift = sql_prefix("RSHIFT", 2),
- trunc = sql_prefix("TRUNC", 2),
- contains = sql_prefix("CONTAINS", 2),
- convert_to = sql_prefix("CONVERT_TO", 2),
- convert_from = sql_prefix("CONVERT_FROM", 2),
- string_binary = sql_prefix("STRING_BINARY", 1),
- binary_string = sql_prefix("BINARY_STRING", 1),
- to_char = sql_prefix("TO_CHAR", 2),
- to_date = sql_prefix("TO_DATE", 2),
- to_number = sql_prefix("TO_NUMBER", 2),
- char_to_timestamp = sql_prefix("TO_TIMESTAMP", 2),
- double_to_timestamp = sql_prefix("TO_TIMESTAMP", 1),
- char_length = sql_prefix("CHAR_LENGTH", 1),
- flatten = sql_prefix("FLATTEN", 1),
- kvgen = sql_prefix("KVGEN", 1),
- repeated_count = sql_prefix("REPEATED_COUNT", 1),
- repeated_contains = sql_prefix("REPEATED_CONTAINS", 2),
- ilike = sql_prefix("ILIKE", 2),
- init_cap = sql_prefix("INIT_CAP", 1),
- length = sql_prefix("LENGTH", 1),
- lower = sql_prefix("LOWER", 1),
- tolower = sql_prefix("LOWER", 1),
- ltrim = sql_prefix("LTRIM", 2),
- nullif = sql_prefix("NULLIF", 2),
+ row_number = dbplyr::sql_prefix("row_number", 0),
+ lshift = dbplyr::sql_prefix("LSHIFT", 2),
+ mod = dbplyr::sql_prefix("MOD", 2),
+ age = dbplyr::sql_prefix("AGE", 1),
+ negative = dbplyr::sql_prefix("NEGATIVE", 1),
+ pi = dbplyr::sql_prefix("PI", 0),
+ pow = dbplyr::sql_prefix("POW", 2),
+ radians = dbplyr::sql_prefix("RADIANS", 1),
+ rand = dbplyr::sql_prefix("RAND", 0),
+ rshift = dbplyr::sql_prefix("RSHIFT", 2),
+ trunc = dbplyr::sql_prefix("TRUNC", 2),
+ contains = dbplyr::sql_prefix("CONTAINS", 2),
+ convert_to = dbplyr::sql_prefix("CONVERT_TO", 2),
+ convert_from = dbplyr::sql_prefix("CONVERT_FROM", 2),
+ string_binary = dbplyr::sql_prefix("STRING_BINARY", 1),
+ binary_string = dbplyr::sql_prefix("BINARY_STRING", 1),
+ to_char = dbplyr::sql_prefix("TO_CHAR", 2),
+ to_date = dbplyr::sql_prefix("TO_DATE", 2),
+ to_number = dbplyr::sql_prefix("TO_NUMBER", 2),
+ char_to_timestamp = dbplyr::sql_prefix("TO_TIMESTAMP", 2),
+ double_to_timestamp = dbplyr::sql_prefix("TO_TIMESTAMP", 1),
+ char_length = dbplyr::sql_prefix("CHAR_LENGTH", 1),
+ flatten = dbplyr::sql_prefix("FLATTEN", 1),
+ kvgen = dbplyr::sql_prefix("KVGEN", 1),
+ repeated_count = dbplyr::sql_prefix("REPEATED_COUNT", 1),
+ repeated_contains = dbplyr::sql_prefix("REPEATED_CONTAINS", 2),
+ ilike = dbplyr::sql_prefix("ILIKE", 2),
+ init_cap = dbplyr::sql_prefix("INIT_CAP", 1),
+ length = dbplyr::sql_prefix("LENGTH", 1),
+ lower = dbplyr::sql_prefix("LOWER", 1),
+ tolower = dbplyr::sql_prefix("LOWER", 1),
+ ltrim = dbplyr::sql_prefix("LTRIM", 2),
+ nullif = dbplyr::sql_prefix("NULLIF", 2),
position = function(x, y) build_sql("POSITION(", x, " IN ", y, ")"),
- regexp_replace = sql_prefix("REGEXP_REPLACE", 3),
- rtrim = sql_prefix("RTRIM", 2),
- rpad = sql_prefix("RPAD", 2),
- rpad_with = sql_prefix("RPAD", 3),
- lpad = sql_prefix("LPAD", 2),
- lpad_with = sql_prefix("LPAD", 3),
- strpos = sql_prefix("STRPOS", 2),
- substr = sql_prefix("SUBSTR", 3),
+ regexp_replace = dbplyr::sql_prefix("REGEXP_REPLACE", 3),
+ rtrim = dbplyr::sql_prefix("RTRIM", 2),
+ rpad = dbplyr::sql_prefix("RPAD", 2),
+ rpad_with = dbplyr::sql_prefix("RPAD", 3),
+ lpad = dbplyr::sql_prefix("LPAD", 2),
+ lpad_with = dbplyr::sql_prefix("LPAD", 3),
+ strpos = dbplyr::sql_prefix("STRPOS", 2),
+ substr = dbplyr::sql_prefix("SUBSTR", 3),
trim = function(x, y, z) build_sql("TRIM(", x, " ", y, " FROM ", z, ")"),
- upper = sql_prefix("UPPER", 1),
- toupper = sql_prefix("UPPER", 1)
+ upper = dbplyr::sql_prefix("UPPER", 1),
+ toupper = dbplyr::sql_prefix("UPPER", 1)
),
aggregate = dbplyr::sql_translator(
M R/drill-docker.R => R/drill-docker.R +1 -1
@@ 33,7 33,7 @@
#' @examples \dontrun{
#' drill_up(data_dir = "~/Data")
#' }
-drill_up <- function(image = "drill/apache-drill:1.15.0",
+drill_up <- function(image = "drill/apache-drill:1.16.0",
container_name = "drill",
data_dir = getwd(), remove = TRUE) {
M R/query.r => R/query.r +18 -3
@@ 96,12 96,19 @@ drill_uplift <- function(query_result) {
}
if (length(query_result$columns) != 0) {
+
if (is.data.frame(query_result$rows)) {
- if (nrow(query_result$rows) > 0) query_result$rows <-
- query_result$rows[,query_result$columns,drop=FALSE]
+
+ if (nrow(query_result$rows) > 0) {
+ query_result$rows <- query_result$rows[,query_result$columns,drop=FALSE]
+ }
+
} else {
+
lapply(1:length(query_result$columns), function(col_idx) {
+
ctype <- query_result$metadata[col_idx]
+
if (ctype == "INT") {
integer(0)
} else if (ctype == "VARCHAR") {
@@ 131,13 138,21 @@ drill_uplift <- function(query_result) {
} else {
character(0)
}
+
}) -> xdf
+
xdf <- set_names(xdf, query_result$columns)
class(xdf) <- c("data.frame")
return(xdf)
+
}
- }
+ } else {
+
+ xdf <- dplyr::tibble()
+ return(xdf)
+
+ }
# ** only available in Drill 1.15.0+ **
# be smarter about type conversion now that the REST API provides
M R/schemas.R => R/schemas.R +15 -9
@@ 1,11 1,13 @@
#' Returns a list of available schemas.
#'
#' @param drill_con drill server connection object setup by \code{drill_connection()}
+#' @param .progress if \code{TRUE} (default if in an interactive session) then ask
+#' \code{httr::POST} to display a progress bar
#' @references \href{https://drill.apache.org/docs/}{Drill documentation}
-#' @family Drill direct REST API Interface
+#' @family Dill direct REST API Interface
#' @export
-drill_show_schemas <- function(drill_con) {
- drill_query(drill_con, "SHOW SCHEMAS", .progress=FALSE)
+drill_show_schemas <- function(drill_con, .progress=interactive()) {
+ drill_query(drill_con, "SHOW SCHEMAS", .progress = .progress)
}
#' Change to a particular schema.
@@ 13,12 15,14 @@ drill_show_schemas <- function(drill_con) {
#' @param drill_con drill server connection object setup by \code{drill_connection()}
#' @param schema_name A unique name for a Drill schema. A schema in Drill is a configured
#' storage plugin, such as hive, or a storage plugin and workspace.
+#' @param .progress if \code{TRUE} (default if in an interactive session) then ask
+#' \code{httr::POST} to display a progress bar
#' @references \href{https://drill.apache.org/docs/}{Drill documentation}
-#' @family Drill direct REST API Interface
+#' @family Dill direct REST API Interface
#' @export
-drill_use <- function(drill_con, schema_name) {
+drill_use <- function(drill_con, schema_name, .progress=interactive()) {
query <- sprintf("USE `%s`", schema_name)
- out <- drill_query(drill_con, query, .progress=FALSE)
+ out <- drill_query(drill_con, query, .progress = .progress)
if (!("errorMessage" %in% names(out))) message(out)
invisible(out)
}
@@ 27,15 31,17 @@ drill_use <- function(drill_con, schema_name) {
#'
#' @param drill_con drill server connection object setup by \code{drill_connection()}
#' @param schema_spec properly quoted "filesystem.directory_name" reference path
+#' @param .progress if \code{TRUE} (default if in an interactive session) then ask
+#' \code{httr::POST} to display a progress bar
#' @export
#' @references \href{https://drill.apache.org/docs/}{Drill documentation}
-#' @family Drill direct REST API Interface
+#' @family Dill direct REST API Interface
#' @examples
#' try({
#' drill_connection() %>% drill_show_files("dfs.tmp")
#' }, silent=TRUE)
-drill_show_files <- function(drill_con, schema_spec) {
+drill_show_files <- function(drill_con, schema_spec, .progress=interactive()) {
query <- sprintf("SHOW FILES IN %s", schema_spec)
- drill_query(drill_con, query, uplift=TRUE, .progress=FALSE) %>%
+ drill_query(drill_con, query, uplift=TRUE, .progress = .progress) %>%
dplyr::select(name, isDirectory, permissions, dplyr::everything())
}
M R/set.R => R/set.R +6 -6
@@ 29,9 29,9 @@ drill_set <- function(drill_con, ..., type=c("session", "system")) {
purrr::map_df(function(x) {
y <- drill_query(drill_con, x, .progress=FALSE)
if (length(y) == 2) {
- dplyr::data_frame(query=x, param=y$summary, value=y$ok, error_msg=NA)
+ dplyr::tibble(query=x, param=y$summary, value=y$ok, error_msg=NA)
} else {
- dplyr::data_frame(query=x, param=NA, value=NA, error_msg=y[[1]])
+ dplyr::tibble(query=x, param=NA, value=NA, error_msg=y[[1]])
}
}) -> res
@@ 70,9 70,9 @@ drill_system_reset <- function(drill_con, ..., all=FALSE) {
purrr::map_df(function(x) {
y <- drill_query(drill_con, x)
if (length(y) == 2) {
- dplyr::data_frame(query=x, param=y[[2]]$summary, value=y[[2]]$ok, error=NA)
+ dplyr::tibble(query=x, param=y[[2]]$summary, value=y[[2]]$ok, error=NA)
} else {
- dplyr::data_frame(query=x, param=NA, value=NA, error=y[[1]])
+ dplyr::tibble(query=x, param=NA, value=NA, error=y[[1]])
}
}) -> res
@@ 110,9 110,9 @@ drill_settings_reset <- function(drill_con, ...) {
purrr::map_df(function(x) {
y <- drill_query(drill_con, x)
if (length(y) == 2) {
- dplyr::data_frame(query=x, param=y[[2]]$summary, value=y[[2]]$ok, error=NA)
+ dplyr::tibble(query=x, param=y[[2]]$summary, value=y[[2]]$ok, error=NA)
} else {
- dplyr::data_frame(query=x, param=NA, value=NA, error=y[[1]])
+ dplyr::tibble(query=x, param=NA, value=NA, error=y[[1]])
}
}) -> res
M README.Rmd => README.Rmd +2 -2
@@ 10,7 10,7 @@ knitr::opts_chunk$set(
message = FALSE,
warning = FALSE,
collapse = TRUE,
- comment = "##",
+ comment = "## ",
fig.path = "README-"
)
options(sergeant.bigint.warnonce = FALSE)
@@ 152,7 152,7 @@ drill_storage(dc)$name
drill_query(dc, "SELECT * FROM cp.`employee.json` limit 100")
-drill_query(dc, "SELECT COUNT(gender) AS gender FROM cp.`employee.json` GROUP BY gender")
+drill_query(dc, "SELECT COUNT(gender) AS gctFROM cp.`employee.json` GROUP BY gender")
drill_options(dc)
M README.md => README.md +155 -157
@@ 69,7 69,7 @@ The following functions are implemented:
- `src_drill`: Connect to Drill (using `dplyr`) + supporting functions
Note that a number of Drill SQL functions have been mapped to R
-functions (e.g. `grepl`) to make it easier to transition from
+functions (e.g. `grepl`) to make it easier to transition from
non-database-backed SQL ops to Drill. See the help on
`drill_custom_functions` for more info on these helper Drill custom
function mappings.
@@ 111,11 111,10 @@ function mappings.
**Helpers**
- `ctas_profile`: Generate a Drill CTAS Statement from a Query
-
- - - `drill_up`: Start a Dockerized Drill Instance
- - `showall_drill`: Show all dead and running Drill Docker containers
- - `sdrill_down`: stop a Dockerized Drill Instance by container id
- - `topall_drill`: Prune all dead and running Drill Docker containers
+ - `drill_up`: sart a Dockerized Drill Instance \# `sdrill_down`: stop
+ a Dockerized Drill Instance by container id
+ - `howall_drill`: Show all dead and running Drill Docker containers
+ - `stopall_drill`: Prune all dead and running Drill Docker containers
# Installation
@@ 137,25 136,25 @@ db <- tbl(ds, "cp.`employee.json`")
# without `collect()`:
count(db, gender, marital_status)
-## # Source: lazy query [?? x 3]
-## # Database: DrillConnection
-## # Groups: gender
-## gender marital_status n
-## <chr> <chr> <dbl>
-## 1 F S 297
-## 2 M M 278
-## 3 M S 276
-## 4 F M 304
+## # Source: lazy query [?? x 3]
+## # Database: DrillConnection
+## # Groups: gender
+## gender marital_status n
+## <chr> <chr> <dbl>
+## 1 F S 297
+## 2 M M 278
+## 3 M S 276
+## 4 F M 304
count(db, gender, marital_status) %>% collect()
-## # A tibble: 4 x 3
-## # Groups: gender [2]
-## gender marital_status n
-## * <chr> <chr> <dbl>
-## 1 F S 297
-## 2 M M 278
-## 3 M S 276
-## 4 F M 304
+## # A tibble: 4 x 3
+## # Groups: gender [2]
+## gender marital_status n
+## <chr> <chr> <dbl>
+## 1 F S 297
+## 2 M M 278
+## 3 M S 276
+## 4 F M 304
group_by(db, position_title) %>%
count(gender) -> tmp2
@@ 166,49 165,49 @@ group_by(db, position_title) %>%
mutate(full_desc = ifelse(gender == "F", "Female", "Male")) %>%
collect() %>%
select(Title = position_title, Gender = full_desc, Count = n)
-## # A tibble: 30 x 3
-## Title Gender Count
-## * <chr> <chr> <dbl>
-## 1 President Female 1
-## 2 VP Country Manager Male 3
-## 3 VP Country Manager Female 3
-## 4 VP Information Systems Female 1
-## 5 VP Human Resources Female 1
-## 6 Store Manager Female 13
-## 7 VP Finance Male 1
-## 8 Store Manager Male 11
-## 9 HQ Marketing Female 2
-## 10 HQ Information Systems Female 4
-## # ... with 20 more rows
+## # A tibble: 30 x 3
+## Title Gender Count
+## <chr> <chr> <dbl>
+## 1 President Female 1
+## 2 VP Country Manager Male 3
+## 3 VP Country Manager Female 3
+## 4 VP Information Systems Female 1
+## 5 VP Human Resources Female 1
+## 6 Store Manager Female 13
+## 7 VP Finance Male 1
+## 8 Store Manager Male 11
+## 9 HQ Marketing Female 2
+## 10 HQ Information Systems Female 4
+## # … with 20 more rows
arrange(db, desc(employee_id)) %>% print(n = 20)
-## # Source: table<cp.`employee.json`> [?? x 20]
-## # Database: DrillConnection
-## # Ordered by: desc(employee_id)
-## employee_id full_name first_name last_name position_id position_title store_id department_id birth_date hire_date
-## <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
-## 1 999 Beverly … Beverly Dittmar 17 Store Permane… 8 17 1914-02-02 1998-01-…
-## 2 998 Elizabet… Elizabeth Jantzer 17 Store Permane… 8 17 1914-02-02 1998-01-…
-## 3 997 John Swe… John Sweet 17 Store Permane… 8 17 1914-02-02 1998-01-…
-## 4 996 William … William Murphy 17 Store Permane… 8 17 1914-02-02 1998-01-…
-## 5 995 Carol Li… Carol Lindsay 17 Store Permane… 8 17 1914-02-02 1998-01-…
-## 6 994 Richard … Richard Burke 17 Store Permane… 8 17 1914-02-02 1998-01-…
-## 7 993 Ethan Bu… Ethan Bunosky 17 Store Permane… 8 17 1914-02-02 1998-01-…
-## 8 992 Claudett… Claudette Cabrera 17 Store Permane… 8 17 1914-02-02 1998-01-…
-## 9 991 Maria Te… Maria Terry 17 Store Permane… 8 17 1914-02-02 1998-01-…
-## 10 990 Stacey C… Stacey Case 17 Store Permane… 8 17 1914-02-02 1998-01-…
-## 11 99 Elizabet… Elizabeth Horne 18 Store Tempora… 6 18 1976-10-05 1997-01-…
-## 12 989 Dominick… Dominick Nutter 17 Store Permane… 8 17 1914-02-02 1998-01-…
-## 13 988 Brian Wi… Brian Willeford 17 Store Permane… 8 17 1914-02-02 1998-01-…
-## 14 987 Margaret… Margaret Clendenen 17 Store Permane… 8 17 1914-02-02 1998-01-…
-## 15 986 Maeve Wa… Maeve Wall 17 Store Permane… 8 17 1914-02-02 1998-01-…
-## 16 985 Mildred … Mildred Morrow 16 Store Tempora… 8 16 1914-02-02 1998-01-…
-## 17 984 French W… French Wilson 16 Store Tempora… 8 16 1914-02-02 1998-01-…
-## 18 983 Elisabet… Elisabeth Duncan 16 Store Tempora… 8 16 1914-02-02 1998-01-…
-## 19 982 Linda An… Linda Anderson 16 Store Tempora… 8 16 1914-02-02 1998-01-…
-## 20 981 Selene W… Selene Watson 16 Store Tempora… 8 16 1914-02-02 1998-01-…
-## # ... with more rows, and 6 more variables: salary <chr>, supervisor_id <chr>, education_level <chr>,
-## # marital_status <chr>, gender <chr>, management_role <chr>
+## # Source: table<cp.`employee.json`> [?? x 20]
+## # Database: DrillConnection
+## # Ordered by: desc(employee_id)
+## employee_id full_name first_name last_name position_id position_title store_id department_id birth_date hire_date
+## <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
+## 1 999 Beverly … Beverly Dittmar 17 Store Permane… 8 17 1914-02-02 1998-01-…
+## 2 998 Elizabet… Elizabeth Jantzer 17 Store Permane… 8 17 1914-02-02 1998-01-…
+## 3 997 John Swe… John Sweet 17 Store Permane… 8 17 1914-02-02 1998-01-…
+## 4 996 William … William Murphy 17 Store Permane… 8 17 1914-02-02 1998-01-…
+## 5 995 Carol Li… Carol Lindsay 17 Store Permane… 8 17 1914-02-02 1998-01-…
+## 6 994 Richard … Richard Burke 17 Store Permane… 8 17 1914-02-02 1998-01-…
+## 7 993 Ethan Bu… Ethan Bunosky 17 Store Permane… 8 17 1914-02-02 1998-01-…
+## 8 992 Claudett… Claudette Cabrera 17 Store Permane… 8 17 1914-02-02 1998-01-…
+## 9 991 Maria Te… Maria Terry 17 Store Permane… 8 17 1914-02-02 1998-01-…
+## 10 990 Stacey C… Stacey Case 17 Store Permane… 8 17 1914-02-02 1998-01-…
+## 11 99 Elizabet… Elizabeth Horne 18 Store Tempora… 6 18 1976-10-05 1997-01-…
+## 12 989 Dominick… Dominick Nutter 17 Store Permane… 8 17 1914-02-02 1998-01-…
+## 13 988 Brian Wi… Brian Willeford 17 Store Permane… 8 17 1914-02-02 1998-01-…
+## 14 987 Margaret… Margaret Clendenen 17 Store Permane… 8 17 1914-02-02 1998-01-…
+## 15 986 Maeve Wa… Maeve Wall 17 Store Permane… 8 17 1914-02-02 1998-01-…
+## 16 985 Mildred … Mildred Morrow 16 Store Tempora… 8 16 1914-02-02 1998-01-…
+## 17 984 French W… French Wilson 16 Store Tempora… 8 16 1914-02-02 1998-01-…
+## 18 983 Elisabet… Elisabeth Duncan 16 Store Tempora… 8 16 1914-02-02 1998-01-…
+## 19 982 Linda An… Linda Anderson 16 Store Tempora… 8 16 1914-02-02 1998-01-…
+## 20 981 Selene W… Selene Watson 16 Store Tempora… 8 16 1914-02-02 1998-01-…
+## # … with more rows, and 6 more variables: salary <chr>, supervisor_id <chr>, education_level <chr>,
+## # marital_status <chr>, gender <chr>, management_role <chr>
mutate(db, position_title = tolower(position_title)) %>%
mutate(salary = as.numeric(salary)) %>%
@@ 217,20 216,20 @@ mutate(db, position_title = tolower(position_title)) %>%
group_by(supervisor_id) %>%
summarise(underlings_count = n()) %>%
collect()
-## # A tibble: 112 x 2
-## supervisor_id underlings_count
-## * <chr> <dbl>
-## 1 0 1
-## 2 1 7
-## 3 5 9
-## 4 4 2
-## 5 2 3
-## 6 20 2
-## 7 21 4
-## 8 22 7
-## 9 6 4
-## 10 36 2
-## # ... with 102 more rows
+## # A tibble: 112 x 2
+## supervisor_id underlings_count
+## <chr> <dbl>
+## 1 0 1
+## 2 1 7
+## 3 5 9
+## 4 4 2
+## 5 2 3
+## 6 20 2
+## 7 21 4
+## 8 22 7
+## 9 6 4
+## 10 36 2
+## # … with 102 more rows
```
### REST API
@@ 239,93 238,92 @@ mutate(db, position_title = tolower(position_title)) %>%
dc <- drill_connection("localhost")
drill_active(dc)
-## [1] TRUE
+## [1] TRUE
drill_version(dc)
-## [1] "1.15.0"
+## [1] "1.15.0"
drill_storage(dc)$name
-## [1] "cp" "dfs" "drilldat" "hbase" "hdfs" "hive" "kudu" "mongo" "my" "s3"
+## [1] "cp" "dfs" "drilldat" "hbase" "hdfs" "hive" "kudu" "mongo" "my" "s3"
drill_query(dc, "SELECT * FROM cp.`employee.json` limit 100")
-## # A tibble: 100 x 16
-## employee_id full_name first_name last_name position_id position_title store_id department_id birth_date hire_date
-## * <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
-## 1 1 Sheri No… Sheri Nowmer 1 President 0 1 1961-08-26 1994-12-…
-## 2 2 Derrick … Derrick Whelply 2 VP Country Ma… 0 1 1915-07-03 1994-12-…
-## 3 4 Michael … Michael Spence 2 VP Country Ma… 0 1 1969-06-20 1998-01-…
-## 4 5 Maya Gut… Maya Gutierrez 2 VP Country Ma… 0 1 1951-05-10 1998-01-…
-## 5 6 Roberta … Roberta Damstra 3 VP Informatio… 0 2 1942-10-08 1994-12-…
-## 6 7 Rebecca … Rebecca Kanagaki 4 VP Human Reso… 0 3 1949-03-27 1994-12-…
-## 7 8 Kim Brun… Kim Brunner 11 Store Manager 9 11 1922-08-10 1998-01-…
-## 8 9 Brenda B… Brenda Blumberg 11 Store Manager 21 11 1979-06-23 1998-01-…
-## 9 10 Darren S… Darren Stanz 5 VP Finance 0 5 1949-08-26 1994-12-…
-## 10 11 Jonathan… Jonathan Murraiin 11 Store Manager 1 11 1967-06-20 1998-01-…
-## # ... with 90 more rows, and 6 more variables: salary <chr>, supervisor_id <chr>, education_level <chr>,
-## # marital_status <chr>, gender <chr>, management_role <chr>
-
-drill_query(dc, "SELECT COUNT(gender) AS gender FROM cp.`employee.json` GROUP BY gender")
+## # A tibble: 100 x 16
+## employee_id full_name first_name last_name position_id position_title store_id department_id birth_date hire_date
+## <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
+## 1 1 Sheri No… Sheri Nowmer 1 President 0 1 1961-08-26 1994-12-…
+## 2 2 Derrick … Derrick Whelply 2 VP Country Ma… 0 1 1915-07-03 1994-12-…
+## 3 4 Michael … Michael Spence 2 VP Country Ma… 0 1 1969-06-20 1998-01-…
+## 4 5 Maya Gut… Maya Gutierrez 2 VP Country Ma… 0 1 1951-05-10 1998-01-…
+## 5 6 Roberta … Roberta Damstra 3 VP Informatio… 0 2 1942-10-08 1994-12-…
+## 6 7 Rebecca … Rebecca Kanagaki 4 VP Human Reso… 0 3 1949-03-27 1994-12-…
+## 7 8 Kim Brun… Kim Brunner 11 Store Manager 9 11 1922-08-10 1998-01-…
+## 8 9 Brenda B… Brenda Blumberg 11 Store Manager 21 11 1979-06-23 1998-01-…
+## 9 10 Darren S… Darren Stanz 5 VP Finance 0 5 1949-08-26 1994-12-…
+## 10 11 Jonathan… Jonathan Murraiin 11 Store Manager 1 11 1967-06-20 1998-01-…
+## # … with 90 more rows, and 6 more variables: salary <chr>, supervisor_id <chr>, education_level <chr>,
+## # marital_status <chr>, gender <chr>, management_role <chr>
+
+drill_query(dc, "SELECT COUNT(gender) AS gctFROM cp.`employee.json` GROUP BY gender")
drill_options(dc)
-## # A tibble: 179 x 6
-## name value defaultValue accessibleScopes kind optionScope
-## * <chr> <chr> <chr> <chr> <chr> <chr>
-## 1 debug.validate_iterators FALSE false ALL BOOLE… BOOT
-## 2 debug.validate_vectors FALSE false ALL BOOLE… BOOT
-## 3 drill.exec.functions.cast_empty_string_to_null FALSE false ALL BOOLE… BOOT
-## 4 drill.exec.hashagg.fallback.enabled FALSE false ALL BOOLE… BOOT
-## 5 drill.exec.hashjoin.fallback.enabled FALSE false ALL BOOLE… BOOT
-## 6 drill.exec.memory.operator.output_batch_size 16777216 16777216 SYSTEM LONG BOOT
-## 7 drill.exec.memory.operator.output_batch_size_avail_mem_fa… 0.1 0.1 SYSTEM DOUBLE BOOT
-## 8 drill.exec.storage.file.partition.column.label dir dir ALL STRING BOOT
-## 9 drill.exec.storage.implicit.filename.column.label filename filename ALL STRING BOOT
-## 10 drill.exec.storage.implicit.filepath.column.label filepath filepath ALL STRING BOOT
-## # ... with 169 more rows
+## # A tibble: 179 x 6
+## name value defaultValue accessibleScopes kind optionScope
+## <chr> <chr> <chr> <chr> <chr> <chr>
+## 1 debug.validate_iterators FALSE false ALL BOOLE… BOOT
+## 2 debug.validate_vectors FALSE false ALL BOOLE… BOOT
+## 3 drill.exec.functions.cast_empty_string_to_null FALSE false ALL BOOLE… BOOT
+## 4 drill.exec.hashagg.fallback.enabled FALSE false ALL BOOLE… BOOT
+## 5 drill.exec.hashjoin.fallback.enabled FALSE false ALL BOOLE… BOOT
+## 6 drill.exec.memory.operator.output_batch_size 16777216 16777216 SYSTEM LONG BOOT
+## 7 drill.exec.memory.operator.output_batch_size_avail_mem_fac… 0.1 0.1 SYSTEM DOUBLE BOOT
+## 8 drill.exec.storage.file.partition.column.label dir dir ALL STRING BOOT
+## 9 drill.exec.storage.implicit.filename.column.label filename filename ALL STRING BOOT
+## 10 drill.exec.storage.implicit.filepath.column.label filepath filepath ALL STRING BOOT
+## # … with 169 more rows
drill_options(dc, "json")
-## # A tibble: 10 x 6
-## name value defaultValue accessibleScopes kind optionScope
-## <chr> <chr> <chr> <chr> <chr> <chr>
-## 1 store.hive.maprdb_json.optimize_scan_with_native_reader FALSE false ALL BOOLEAN BOOT
-## 2 store.json.all_text_mode TRUE false ALL BOOLEAN SYSTEM
-## 3 store.json.extended_types TRUE false ALL BOOLEAN SYSTEM
-## 4 store.json.read_numbers_as_double FALSE false ALL BOOLEAN BOOT
-## 5 store.json.reader.allow_nan_inf TRUE true ALL BOOLEAN BOOT
-## 6 store.json.reader.print_skipped_invalid_record_number TRUE false ALL BOOLEAN SYSTEM
-## 7 store.json.reader.skip_invalid_records TRUE false ALL BOOLEAN SYSTEM
-## 8 store.json.writer.allow_nan_inf TRUE true ALL BOOLEAN BOOT
-## 9 store.json.writer.skip_null_fields TRUE true ALL BOOLEAN BOOT
-## 10 store.json.writer.uglify TRUE false ALL BOOLEAN SYSTEM
+## # A tibble: 10 x 6
+## name value defaultValue accessibleScopes kind optionScope
+## <chr> <chr> <chr> <chr> <chr> <chr>
+## 1 store.hive.maprdb_json.optimize_scan_with_native_reader FALSE false ALL BOOLEAN BOOT
+## 2 store.json.all_text_mode TRUE false ALL BOOLEAN SYSTEM
+## 3 store.json.extended_types TRUE false ALL BOOLEAN SYSTEM
+## 4 store.json.read_numbers_as_double FALSE false ALL BOOLEAN BOOT
+## 5 store.json.reader.allow_nan_inf TRUE true ALL BOOLEAN BOOT
+## 6 store.json.reader.print_skipped_invalid_record_number TRUE false ALL BOOLEAN SYSTEM
+## 7 store.json.reader.skip_invalid_records TRUE false ALL BOOLEAN SYSTEM
+## 8 store.json.writer.allow_nan_inf TRUE true ALL BOOLEAN BOOT
+## 9 store.json.writer.skip_null_fields TRUE true ALL BOOLEAN BOOT
+## 10 store.json.writer.uglify TRUE false ALL BOOLEAN SYSTEM
```
## Working with parquet files
``` r
drill_query(dc, "SELECT * FROM dfs.`/usr/local/drill/sample-data/nation.parquet` LIMIT 5")
-## # A tibble: 5 x 4
-## N_NATIONKEY N_NAME N_REGIONKEY N_COMMENT
-## * <dbl> <chr> <dbl> <chr>
-## 1 0 ALGERIA 0 haggle. carefully f
-## 2 1 ARGENTINA 1 al foxes promise sly
-## 3 2 BRAZIL 1 y alongside of the p
-## 4 3 CANADA 1 eas hang ironic, sil
-## 5 4 EGYPT 4 y above the carefull
+## # A tibble: 5 x 4
+## N_NATIONKEY N_NAME N_REGIONKEY N_COMMENT
+## <dbl> <chr> <dbl> <chr>
+## 1 0 ALGERIA 0 haggle. carefully f
+## 2 1 ARGENTINA 1 al foxes promise sly
+## 3 2 BRAZIL 1 y alongside of the p
+## 4 3 CANADA 1 eas hang ironic, sil
+## 5 4 EGYPT 4 y above the carefull
```
Including multiple parquet files in different directories (note the
-wildcard
-support):
+wildcard support):
``` r
drill_query(dc, "SELECT * FROM dfs.`/usr/local/drill/sample-data/nations*/nations*.parquet` LIMIT 5")
-## # A tibble: 5 x 5
-## dir0 N_NATIONKEY N_NAME N_REGIONKEY N_COMMENT
-## * <chr> <dbl> <chr> <dbl> <chr>
-## 1 nationsSF 0 ALGERIA 0 haggle. carefully f
-## 2 nationsSF 1 ARGENTINA 1 al foxes promise sly
-## 3 nationsSF 2 BRAZIL 1 y alongside of the p
-## 4 nationsSF 3 CANADA 1 eas hang ironic, sil
-## 5 nationsSF 4 EGYPT 4 y above the carefull
+## # A tibble: 5 x 5
+## dir0 N_NATIONKEY N_NAME N_REGIONKEY N_COMMENT
+## <chr> <dbl> <chr> <dbl> <chr>
+## 1 nationsSF 0 ALGERIA 0 haggle. carefully f
+## 2 nationsSF 1 ARGENTINA 1 al foxes promise sly
+## 3 nationsSF 2 BRAZIL 1 y alongside of the p
+## 4 nationsSF 3 CANADA 1 eas hang ironic, sil
+## 5 nationsSF 4 EGYPT 4 y above the carefull
```
### Drill has built-in support for spatial ops
@@ 346,24 344,24 @@ select columns[2] as city, columns[4] as lon, columns[3] as lat
)
)
")
-## # A tibble: 7 x 3
-## city lon lat
-## * <chr> <chr> <chr>
-## 1 Burbank -121.9316233 37.3232752
-## 2 San Jose -121.8949555 37.3393857
-## 3 Lick -121.8457863 37.2871647
-## 4 Willow Glen -121.8896771 37.3085532
-## 5 Buena Vista -121.9166227 37.3213308
-## 6 Parkmoor -121.9307898 37.3210531
-## 7 Fruitdale -121.932746 37.31086
+## # A tibble: 7 x 3
+## city lon lat
+## <chr> <chr> <chr>
+## 1 Burbank -121.9316233 37.3232752
+## 2 San Jose -121.8949555 37.3393857
+## 3 Lick -121.8457863 37.2871647
+## 4 Willow Glen -121.8896771 37.3085532
+## 5 Buena Vista -121.9166227 37.3213308
+## 6 Parkmoor -121.9307898 37.3210531
+## 7 Fruitdale -121.932746 37.31086
```
### sergeant Metrics
-| Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) |
-| :--- | -------: | ---: | --: | ---: | ----------: | ---: | -------: | ---: |
-| R | 14 | 0.93 | 894 | 0.94 | 236 | 0.81 | 627 | 0.88 |
-| Rmd | 1 | 0.07 | 54 | 0.06 | 56 | 0.19 | 87 | 0.12 |
+| Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) |
+| :--- | -------: | ---: | ---: | ---: | ----------: | ---: | -------: | ---: |
+| R | 18 | 0.95 | 1212 | 0.96 | 349 | 0.86 | 716 | 0.89 |
+| Rmd | 1 | 0.05 | 54 | 0.04 | 56 | 0.14 | 92 | 0.11 |
## Code of Conduct
M man/ctas_profile.Rd => man/ctas_profile.Rd +1 -1
@@ 12,7 12,7 @@ ctas_profile(x, new_table_name = "CHANGE____ME")
\item{new_table_name}{a new Drill data source spec (e.g. \code{dfs.xyz.`a.parquet`})}
}
\description{
-When working with CSV[H] files in Drill 1.15.0+ everyting comes back
+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}
M man/drill_active.Rd => man/drill_active.Rd +3 -6
@@ 25,12 25,9 @@ Other Drill direct REST API Interface: \code{\link{drill_cancel}},
\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_show_files}},
- \code{\link{drill_show_schemas}},
- \code{\link{drill_stats}}, \code{\link{drill_status}},
- \code{\link{drill_storage}},
+ \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_use}},
- \code{\link{drill_version}}
+ \code{\link{drill_threads}}, \code{\link{drill_version}}
}
\concept{Drill direct REST API Interface}
M man/drill_cancel.Rd => man/drill_cancel.Rd +3 -6
@@ 25,12 25,9 @@ Other Drill direct REST API Interface: \code{\link{drill_active}},
\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_show_files}},
- \code{\link{drill_show_schemas}},
- \code{\link{drill_stats}}, \code{\link{drill_status}},
- \code{\link{drill_storage}},
+ \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_use}},
- \code{\link{drill_version}}
+ \code{\link{drill_threads}}, \code{\link{drill_version}}
}
\concept{Drill direct REST API Interface}
M man/drill_connection.Rd => man/drill_connection.Rd +3 -6
@@ 36,12 36,9 @@ Other Drill direct REST API Interface: \code{\link{drill_active}},
\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_show_files}},
- \code{\link{drill_show_schemas}},
- \code{\link{drill_stats}}, \code{\link{drill_status}},
- \code{\link{drill_storage}},
+ \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_use}},
- \code{\link{drill_version}}
+ \code{\link{drill_threads}}, \code{\link{drill_version}}
}
\concept{Drill direct REST API Interface}
M man/drill_functions.Rd => man/drill_functions.Rd +3 -6
@@ 37,12 37,9 @@ Other Drill direct REST API Interface: \code{\link{drill_active}},
\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_show_files}},
- \code{\link{drill_show_schemas}},
- \code{\link{drill_stats}}, \code{\link{drill_status}},
- \code{\link{drill_storage}},
+ \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_use}},
- \code{\link{drill_version}}
+ \code{\link{drill_threads}}, \code{\link{drill_version}}
}
\concept{Drill direct REST API Interface}
M man/drill_metrics.Rd => man/drill_metrics.Rd +3 -6
@@ 26,12 26,9 @@ Other Drill direct REST API Interface: \code{\link{drill_active}},
\code{\link{drill_profiles}},
\code{\link{drill_profile}}, \code{\link{drill_query}},
\code{\link{drill_settings_reset}},
- \code{\link{drill_set}}, \code{\link{drill_show_files}},
- \code{\link{drill_show_schemas}},
- \code{\link{drill_stats}}, \code{\link{drill_status}},
- \code{\link{drill_storage}},
+ \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_use}},
- \code{\link{drill_version}}
+ \code{\link{drill_threads}}, \code{\link{drill_version}}
}
\concept{Drill direct REST API Interface}
M man/drill_options.Rd => man/drill_options.Rd +3 -6
@@ 31,12 31,9 @@ Other Drill direct REST API Interface: \code{\link{drill_active}},
\code{\link{drill_profiles}},
\code{\link{drill_profile}}, \code{\link{drill_query}},
\code{\link{drill_settings_reset}},
- \code{\link{drill_set}}, \code{\link{drill_show_files}},
- \code{\link{drill_show_schemas}},
- \code{\link{drill_stats}}, \code{\link{drill_status}},
- \code{\link{drill_storage}},
+ \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_use}},
- \code{\link{drill_version}}
+ \code{\link{drill_threads}}, \code{\link{drill_version}}
}
\concept{Drill direct REST API Interface}
M man/drill_opts.Rd => man/drill_opts.Rd +3 -6
@@ 38,12 38,9 @@ Other Drill direct REST API Interface: \code{\link{drill_active}},
\code{\link{drill_profiles}},
\code{\link{drill_profile}}, \code{\link{drill_query}},
\code{\link{drill_settings_reset}},
- \code{\link{drill_set}}, \code{\link{drill_show_files}},
- \code{\link{drill_show_schemas}},
- \code{\link{drill_stats}}, \code{\link{drill_status}},
- \code{\link{drill_storage}},
+ \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_use}},
- \code{\link{drill_version}}
+ \code{\link{drill_threads}}, \code{\link{drill_version}}
}
\concept{Drill direct REST API Interface}
M man/drill_profile.Rd => man/drill_profile.Rd +3 -6
@@ 26,12 26,9 @@ Other Drill direct REST API Interface: \code{\link{drill_active}},
\code{\link{drill_opts}}, \code{\link{drill_profiles}},
\code{\link{drill_query}},
\code{\link{drill_settings_reset}},
- \code{\link{drill_set}}, \code{\link{drill_show_files}},
- \code{\link{drill_show_schemas}},
- \code{\link{drill_stats}}, \code{\link{drill_status}},
- \code{\link{drill_storage}},
+ \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_use}},
- \code{\link{drill_version}}
+ \code{\link{drill_threads}}, \code{\link{drill_version}}
}
\concept{Drill direct REST API Interface}
M man/drill_profiles.Rd => man/drill_profiles.Rd +3 -6
@@ 29,12 29,9 @@ Other Drill direct REST API Interface: \code{\link{drill_active}},
\code{\link{drill_opts}}, \code{\link{drill_profile}},
\code{\link{drill_query}},
\code{\link{drill_settings_reset}},
- \code{\link{drill_set}}, \code{\link{drill_show_files}},
- \code{\link{drill_show_schemas}},
- \code{\link{drill_stats}}, \code{\link{drill_status}},
- \code{\link{drill_storage}},
+ \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_use}},
- \code{\link{drill_version}}
+ \code{\link{drill_threads}}, \code{\link{drill_version}}
}
\concept{Drill direct REST API Interface}
M man/drill_query.Rd => man/drill_query.Rd +3 -6
@@ 44,12 44,9 @@ Other Drill direct REST API Interface: \code{\link{drill_active}},
\code{\link{drill_opts}}, \code{\link{drill_profiles}},
\code{\link{drill_profile}},
\code{\link{drill_settings_reset}},
- \code{\link{drill_set}}, \code{\link{drill_show_files}},
- \code{\link{drill_show_schemas}},
- \code{\link{drill_stats}}, \code{\link{drill_status}},
- \code{\link{drill_storage}},
+ \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_use}},
- \code{\link{drill_version}}
+ \code{\link{drill_threads}}, \code{\link{drill_version}}
}
\concept{Drill direct REST API Interface}
M man/drill_set.Rd => man/drill_set.Rd +1 -4
@@ 42,12 42,9 @@ Other Drill direct REST API Interface: \code{\link{drill_active}},
\code{\link{drill_opts}}, \code{\link{drill_profiles}},
\code{\link{drill_profile}}, \code{\link{drill_query}},
\code{\link{drill_settings_reset}},
- \code{\link{drill_show_files}},
- \code{\link{drill_show_schemas}},
\code{\link{drill_stats}}, \code{\link{drill_status}},
\code{\link{drill_storage}},
\code{\link{drill_system_reset}},
- \code{\link{drill_threads}}, \code{\link{drill_use}},
- \code{\link{drill_version}}
+ \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 +3 -6
@@ 30,12 30,9 @@ Other Drill direct REST API Interface: \code{\link{drill_active}},
\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_show_files}},
- \code{\link{drill_show_schemas}},
- \code{\link{drill_stats}}, \code{\link{drill_status}},
- \code{\link{drill_storage}},
+ \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_use}},
- \code{\link{drill_version}}
+ \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 +7 -17
@@ 4,12 4,15 @@
\alias{drill_show_files}
\title{Show files in a file system schema.}
\usage{
-drill_show_files(drill_con, schema_spec)
+drill_show_files(drill_con, schema_spec, .progress = interactive())
}
\arguments{
\item{drill_con}{drill server connection object setup by \code{drill_connection()}}
\item{schema_spec}{properly quoted "filesystem.directory_name" reference path}
+
+\item{.progress}{if \code{TRUE} (default if in an interactive session) then ask
+\code{httr::POST} to display a progress bar}
}
\description{
Show files in a file system schema.
@@ 23,20 26,7 @@ drill_connection() \%>\% drill_show_files("dfs.tmp")
\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_show_schemas}},
- \code{\link{drill_stats}}, \code{\link{drill_status}},
- \code{\link{drill_storage}},
- \code{\link{drill_system_reset}},
- \code{\link{drill_threads}}, \code{\link{drill_use}},
- \code{\link{drill_version}}
+Other Dill direct REST API Interface: \code{\link{drill_show_schemas}},
+ \code{\link{drill_use}}
}
-\concept{Drill direct REST API Interface}
+\concept{Dill direct REST API Interface}
M man/drill_show_schemas.Rd => man/drill_show_schemas.Rd +7 -16
@@ 4,10 4,13 @@
\alias{drill_show_schemas}
\title{Returns a list of available schemas.}
\usage{
-drill_show_schemas(drill_con)
+drill_show_schemas(drill_con, .progress = interactive())
}
\arguments{
\item{drill_con}{drill server connection object setup by \code{drill_connection()}}
+
+\item{.progress}{if \code{TRUE} (default if in an interactive session) then ask
+\code{httr::POST} to display a progress bar}
}
\description{
Returns a list of available schemas.
@@ 16,19 19,7 @@ Returns a list of available schemas.
\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_show_files}},
- \code{\link{drill_stats}}, \code{\link{drill_status}},
- \code{\link{drill_storage}},
- \code{\link{drill_system_reset}},
- \code{\link{drill_threads}}, \code{\link{drill_use}},
- \code{\link{drill_version}}
+Other Dill direct REST API Interface: \code{\link{drill_show_files}},
+ \code{\link{drill_use}}
}
-\concept{Drill direct REST API Interface}
+\concept{Dill direct REST API Interface}
M man/drill_stats.Rd => man/drill_stats.Rd +3 -5
@@ 29,11 29,9 @@ Other Drill direct REST API Interface: \code{\link{drill_active}},
\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_show_files}},
- \code{\link{drill_show_schemas}},
- \code{\link{drill_status}}, \code{\link{drill_storage}},
+ \code{\link{drill_set}}, \code{\link{drill_status}},
+ \code{\link{drill_storage}},
\code{\link{drill_system_reset}},
- \code{\link{drill_threads}}, \code{\link{drill_use}},
- \code{\link{drill_version}}
+ \code{\link{drill_threads}}, \code{\link{drill_version}}
}
\concept{Drill direct REST API Interface}
M man/drill_status.Rd => man/drill_status.Rd +3 -5
@@ 29,11 29,9 @@ Other Drill direct REST API Interface: \code{\link{drill_active}},
\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_show_files}},
- \code{\link{drill_show_schemas}},
- \code{\link{drill_stats}}, \code{\link{drill_storage}},
+ \code{\link{drill_set}}, \code{\link{drill_stats}},
+ \code{\link{drill_storage}},
\code{\link{drill_system_reset}},
- \code{\link{drill_threads}}, \code{\link{drill_use}},
- \code{\link{drill_version}}
+ \code{\link{drill_threads}}, \code{\link{drill_version}}
}
\concept{Drill direct REST API Interface}
M man/drill_storage.Rd => man/drill_storage.Rd +3 -5
@@ 70,11 70,9 @@ Other Drill direct REST API Interface: \code{\link{drill_active}},
\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_show_files}},
- \code{\link{drill_show_schemas}},
- \code{\link{drill_stats}}, \code{\link{drill_status}},
+ \code{\link{drill_set}}, \code{\link{drill_stats}},
+ \code{\link{drill_status}},
\code{\link{drill_system_reset}},
- \code{\link{drill_threads}}, \code{\link{drill_use}},
- \code{\link{drill_version}}
+ \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 +3 -5
@@ 33,10 33,8 @@ Other Drill direct REST API Interface: \code{\link{drill_active}},
\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_show_files}},
- \code{\link{drill_show_schemas}},
- \code{\link{drill_stats}}, \code{\link{drill_status}},
- \code{\link{drill_storage}}, \code{\link{drill_threads}},
- \code{\link{drill_use}}, \code{\link{drill_version}}
+ \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 +3 -5
@@ 29,11 29,9 @@ Other Drill direct REST API Interface: \code{\link{drill_active}},
\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_show_files}},
- \code{\link{drill_show_schemas}},
- \code{\link{drill_stats}}, \code{\link{drill_status}},
- \code{\link{drill_storage}},
+ \code{\link{drill_set}}, \code{\link{drill_stats}},
+ \code{\link{drill_status}}, \code{\link{drill_storage}},
\code{\link{drill_system_reset}},
- \code{\link{drill_use}}, \code{\link{drill_version}}
+ \code{\link{drill_version}}
}
\concept{Drill direct REST API Interface}
M man/drill_up.Rd => man/drill_up.Rd +1 -1
@@ 5,7 5,7 @@
\alias{drill_down}
\title{Start a Dockerized Drill Instance}
\usage{
-drill_up(image = "drill/apache-drill:1.15.0", container_name = "drill",
+drill_up(image = "drill/apache-drill:1.16.0", container_name = "drill",
data_dir = getwd(), remove = TRUE)
drill_down(id)
M man/drill_use.Rd => man/drill_use.Rd +7 -16
@@ 4,13 4,16 @@
\alias{drill_use}
\title{Change to a particular schema.}
\usage{
-drill_use(drill_con, schema_name)
+drill_use(drill_con, schema_name, .progress = interactive())
}
\arguments{
\item{drill_con}{drill server connection object setup by \code{drill_connection()}}
\item{schema_name}{A unique name for a Drill schema. A schema in Drill is a configured
storage plugin, such as hive, or a storage plugin and workspace.}
+
+\item{.progress}{if \code{TRUE} (default if in an interactive session) then ask
+\code{httr::POST} to display a progress bar}
}
\description{
Change to a particular schema.
@@ 19,19 22,7 @@ Change to a particular schema.
\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_show_files}},
- \code{\link{drill_show_schemas}},
- \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 Dill direct REST API Interface: \code{\link{drill_show_files}},
+ \code{\link{drill_show_schemas}}
}
-\concept{Drill direct REST API Interface}
+\concept{Dill direct REST API Interface}
M man/drill_version.Rd => man/drill_version.Rd +3 -5
@@ 29,11 29,9 @@ Other Drill direct REST API Interface: \code{\link{drill_active}},
\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_show_files}},
- \code{\link{drill_show_schemas}},
- \code{\link{drill_stats}}, \code{\link{drill_status}},
- \code{\link{drill_storage}},
+ \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_use}}
+ \code{\link{drill_threads}}
}
\concept{Drill direct REST API Interface}
M tests/testthat/test-dbi-internal.R => tests/testthat/test-dbi-internal.R +1 -1
@@ 7,7 7,7 @@ test_that("core DBI ops work", {
testthat::skip_on_cran()
- con <- dbConnect(Drill(), "localhost")
+ con <- dbConnect(Drill(), test_host)
expect_is(con, "DrillConnection")
expect_true(dbIsValid(con))
M tests/testthat/test-dbitest.R => tests/testthat/test-dbitest.R +1 -1
@@ 28,7 28,7 @@ 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", "..."))
-con <- expect_visible(connect(dr))
+con <- expect_visible(dbConnect(dr, test_host))
expect_s4_class(con, "DBIConnection")
expect_true(dbDisconnect(con))
M tests/testthat/test-sergeant.R => tests/testthat/test-sergeant.R +3 -0
@@ 1,3 1,6 @@
+library(dbplyr)
+library(dplyr)
+
test_host <- Sys.getenv("DRILL_TEST_HOST", "localhost")
options(sergeant.bigint.warnonce = FALSE)