table_exists: Check If A Table Exists

View source: R/tables.R

table_existsR Documentation

Check If A Table Exists

Description

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.

Usage

table_exists(sc, table, database = NULL)

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

Details

If database is NULL, table_exists refers to a table in the current database (see current_database()).

Value

A logical(1) vector indicating TRUE if the table exists within the specified database and FALSE otherwise.

See Also

cache_table(), create_table(), get_table(), list_tables(), refresh_table(), uncache_table()

Examples

## Not run: 
sc <- sparklyr::spark_connect(master = "local")
mtcars_spark <- sparklyr::copy_to(dest = sc, df = mtcars)
table_exists(sc = sc, table = "mtcars")

## End(Not run)


catalog documentation built on Aug. 23, 2022, 1:07 a.m.