Browse Source

Added drill_functions() to enable listing of build-in functions & UDFs

rapidjsonr
boB Rudis 5 years ago
parent
commit
435b5e665b
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 1
      NAMESPACE
  2. 3
      NEWS.md
  3. 29
      R/sergeant.r
  4. 1
      README.Rmd
  5. 1
      README.md
  6. 1
      man/drill_active.Rd
  7. 1
      man/drill_cancel.Rd
  8. 5
      man/drill_connection.Rd
  9. 42
      man/drill_functions.Rd
  10. 1
      man/drill_metrics.Rd
  11. 1
      man/drill_options.Rd
  12. 1
      man/drill_profile.Rd
  13. 1
      man/drill_profiles.Rd
  14. 1
      man/drill_query.Rd
  15. 1
      man/drill_set.Rd
  16. 1
      man/drill_settings_reset.Rd
  17. 1
      man/drill_show_files.Rd
  18. 1
      man/drill_show_schemas.Rd
  19. 1
      man/drill_stats.Rd
  20. 1
      man/drill_status.Rd
  21. 3
      man/drill_storage.Rd
  22. 1
      man/drill_system_reset.Rd
  23. 1
      man/drill_threads.Rd
  24. 1
      man/drill_use.Rd
  25. 1
      man/drill_version.Rd

1
NAMESPACE

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

3
NEWS.md

@ -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

29
R/sergeant.r

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

1
README.Rmd

@ -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

1
README.md

@ -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

1
man/drill_active.Rd

@ -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}},

1
man/drill_cancel.Rd

@ -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}},

5
man/drill_connection.Rd

@ -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}},

42
man/drill_functions.Rd

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

1
man/drill_metrics.Rd

@ -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}},

1
man/drill_options.Rd

@ -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}},

1
man/drill_profile.Rd

@ -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}},

1
man/drill_profiles.Rd

@ -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}},

1
man/drill_query.Rd

@ -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}},

1
man/drill_set.Rd

@ -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}},

1
man/drill_settings_reset.Rd

@ -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}},

1
man/drill_show_files.Rd

@ -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}},

1
man/drill_show_schemas.Rd

@ -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}},

1
man/drill_stats.Rd

@ -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}},

1
man/drill_status.Rd

@ -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}},

3
man/drill_storage.Rd

@ -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}},

1
man/drill_system_reset.Rd

@ -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}},

1
man/drill_threads.Rd

@ -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}},

1
man/drill_use.Rd

@ -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}},

1
man/drill_version.Rd

@ -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}},

Loading…
Cancel
Save