M NAMESPACE => NAMESPACE +1 -0
@@ 14,6 14,7 @@ export(Drill)
export(drill_active)
export(drill_cancel)
export(drill_connection)
+export(drill_functions)
export(drill_metrics)
export(drill_mod_storage)
export(drill_options)
M NEWS.md => NEWS.md +3 -0
@@ 2,6 2,9 @@
- Column order preserved in REST API & REST API DBI-based calls if
using Apache Drill 1.15.0+
+- New `drill_functions()` function to show all the available Apache
+ Drill built-in functions & UDFs (Apache Drill 1.15.0+ required)
+
# sergeant 0.7.0-BETA
M R/sergeant.r => R/sergeant.r +29 -0
@@ 300,6 300,35 @@ drill_version <- function(drill_con) {
}
}
+#' Show all the available Drill built-in functions & UDFs
+#'
+#' @md
+#' @param drill_con drill server connection object setup by \code{drill_connection()}
+#' @note You _must_ be using Drill 1.15.0+ to use this function
+#' @export
+#' @family Dill direct REST API Interface
+#' @references \href{https://drill.apache.org/docs/}{Drill documentation}
+#' @examples \dontrun{
+#' drill_connection() %>% drill_functions()
+#' }
+drill_functions <- function(drill_con) {
+
+ stopifnot(utils::compareVersion(drill_version(drill_con), "1.15.0") >= 0)
+
+ if (inherits(drill_con, "src_drill")) {
+ dplyr::collect(
+ dplyr::tbl(drill_con, dplyr::sql("(SELECT * FROM sys.functions)"))
+ )
+ } else {
+ drill_query(
+ drill_con = drill_con,
+ query = "SELECT * FROM sys.functions",
+ uplift = TRUE,
+ .progress = FALSE
+ )
+ }
+}
+
M README.Rmd => README.Rmd +1 -0
@@ 58,6 58,7 @@ Note that a number of Drill SQL functions have been mapped to R functions (e.g.
- `drill_connection`: Setup parameters for a Drill server/cluster connection
- `drill_active`: Test whether Drill HTTP REST API server is up
- `drill_cancel`: Cancel the query that has the given queryid
+- `drill_functions`: Show all the available Drill built-in functions & UDFs (Apache Drill 1.15.0+ required)
- `drill_jdbc`: Connect to Drill using JDBC
- `drill_metrics`: Get the current memory metrics
- `drill_options`: List the name, default, and data type of the system and session options
M README.md => README.md +1 -0
@@ 80,6 80,7 @@ function mappings.
connection
- `drill_active`: Test whether Drill HTTP REST API server is up
- `drill_cancel`: Cancel the query that has the given queryid
+ - `drill_functions`: Show all the available Drill built-in functions & UDFs (Apache Drill 1.15.0+ required)
- `drill_jdbc`: Connect to Drill using JDBC
- `drill_metrics`: Get the current memory metrics
- `drill_options`: List the name, default, and data type of the system
M man/drill_active.Rd => man/drill_active.Rd +1 -0
@@ 20,6 20,7 @@ drill_connection() \%>\% drill_active()
\seealso{
Other Dill 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_profiles}},
\code{\link{drill_profile}}, \code{\link{drill_query}},
M man/drill_cancel.Rd => man/drill_cancel.Rd +1 -0
@@ 20,6 20,7 @@ Cancel the query that has the given queryid
\seealso{
Other Dill 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_profiles}},
\code{\link{drill_profile}}, \code{\link{drill_query}},
M man/drill_connection.Rd => man/drill_connection.Rd +3 -2
@@ 30,8 30,9 @@ dc <- drill_connection()
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
- \code{\link{drill_cancel}}, \code{\link{drill_metrics}},
- \code{\link{drill_options}},
+ \code{\link{drill_cancel}},
+ \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}},
A man/drill_functions.Rd => man/drill_functions.Rd +42 -0
@@ 0,0 1,42 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/sergeant.r
+\name{drill_functions}
+\alias{drill_functions}
+\title{Show all the available Drill built-in functions & UDFs}
+\usage{
+drill_functions(drill_con)
+}
+\arguments{
+\item{drill_con}{drill server connection object setup by \code{drill_connection()}}
+}
+\description{
+Show all the available Drill built-in functions & UDFs
+}
+\note{
+You \emph{must} be using Drill 1.15.0+ to use this function
+}
+\examples{
+\dontrun{
+drill_connection() \%>\% drill_functions()
+}
+}
+\references{
+\href{https://drill.apache.org/docs/}{Drill documentation}
+}
+\seealso{
+Other Dill 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_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_use}},
+ \code{\link{drill_version}}
+}
+\concept{Dill direct REST API Interface}
M man/drill_metrics.Rd => man/drill_metrics.Rd +1 -0
@@ 21,6 21,7 @@ drill_connection() \%>\% drill_metrics()
Other Dill 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_profiles}},
\code{\link{drill_profile}}, \code{\link{drill_query}},
M man/drill_options.Rd => man/drill_options.Rd +1 -0
@@ 26,6 26,7 @@ drill_connection() \%>\% drill_options()
Other Dill 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_profiles}},
\code{\link{drill_profile}}, \code{\link{drill_query}},
M man/drill_profile.Rd => man/drill_profile.Rd +1 -0
@@ 21,6 21,7 @@ Get the profile of the query that has the given queryid
Other Dill 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_query}},
\code{\link{drill_settings_reset}},
M man/drill_profiles.Rd => man/drill_profiles.Rd +1 -0
@@ 24,6 24,7 @@ drill_connection() \%>\% drill_profiles()
Other Dill 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_profile}}, \code{\link{drill_query}},
\code{\link{drill_settings_reset}},
M man/drill_query.Rd => man/drill_query.Rd +1 -0
@@ 39,6 39,7 @@ drill_connection() \%>\%
Other Dill 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}},
M man/drill_set.Rd => man/drill_set.Rd +1 -0
@@ 37,6 37,7 @@ drill_connection() \%>\%
Other Dill 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}},
M man/drill_settings_reset.Rd => man/drill_settings_reset.Rd +1 -0
@@ 26,6 26,7 @@ drill_connection() \%>\% drill_settings_reset(exec.errors.verbose)
Other Dill 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}},
M man/drill_show_files.Rd => man/drill_show_files.Rd +1 -0
@@ 26,6 26,7 @@ drill_connection() \%>\% drill_show_files("dfs.tmp")
Other Dill 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}},
M man/drill_show_schemas.Rd => man/drill_show_schemas.Rd +1 -0
@@ 19,6 19,7 @@ Returns a list of available schemas.
Other Dill 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}},
M man/drill_stats.Rd => man/drill_stats.Rd +1 -0
@@ 24,6 24,7 @@ drill_connection() \%>\% drill_stats()
Other Dill 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}},
M man/drill_status.Rd => man/drill_status.Rd +1 -0
@@ 24,6 24,7 @@ drill_connection() \%>\% drill_status()
Other Dill 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}},
M man/drill_storage.Rd => man/drill_storage.Rd +3 -0
@@ 59,6 59,7 @@ drill_connection() \%>\%
Other Dill 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}},
@@ 73,6 74,7 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Dill 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}},
@@ 87,6 89,7 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Dill 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}},
M man/drill_system_reset.Rd => man/drill_system_reset.Rd +1 -0
@@ 28,6 28,7 @@ drill_connection() \%>\% drill_system_reset(all=TRUE)
Other Dill 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}},
M man/drill_threads.Rd => man/drill_threads.Rd +1 -0
@@ 24,6 24,7 @@ drill_connection() \%>\% drill_threads()
Other Dill 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}},
M man/drill_use.Rd => man/drill_use.Rd +1 -0
@@ 22,6 22,7 @@ Change to a particular schema.
Other Dill 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}},
M man/drill_version.Rd => man/drill_version.Rd +1 -0
@@ 24,6 24,7 @@ drill_connection() \%>\% drill_version()
Other Dill 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}},