Check if the table or view with the specified name exists in the specified database. This can either be a temporary view or a table/view.
Arguments
- sc
A
spark_connection
.- table
character(1)
. The name of the table.- 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 table exists within the
specified database and FALSE
otherwise.
Details
If database
is NULL
, table_exists
refers to a table in the current
database (see current_database()
).
Examples
if (FALSE) {
sc <- sparklyr::spark_connect(master = "local")
mtcars_spark <- sparklyr::copy_to(dest = sc, df = mtcars)
table_exists(sc = sc, table = "mtcars")
}