Check if the function with the specified name exists in the specified database.
Arguments
- sc
A
spark_connection
.- fn
character(1)
. The name of the function.- database
character(1)
. The name of the database for which the functions should be listed (default:NULL
).
Value
A logical(1)
vector indicating TRUE
if the function exists within the
specified database and FALSE
otherwise.
Details
function_exists()
includes in-built functions such as abs
. To see if a
built-in function exists you must use the unqualified name. If you create a
function you can use the qualified name. If you want to check if a built-in
function exists specify the database
as NULL
.
Examples
if (FALSE) {
sc <- sparklyr::spark_connect(master = "local")
function_exists(sc = sc, fn = "abs")
}