DROP TABLE

This command deletes the specified Upsolver table.

Note that if there are existing jobs that are dependent upon the table in question, then it cannot be dropped.

Syntax

DROP TABLE [ IF EXISTS ] <table_identifier> 
    DELETE_DATA = { TRUE | FALSE }
    [ COMPUTE_CLUSTER = <cluster_identifier> ];

DELETE_DATA

Type: Boolean

When false, only the table's metadata is deleted while the data itself is retained in S3.

COMPUTE_CLUSTER

Type: identifier

Default: The sole cluster in your environment

(Optional) The cluster that processes the deletion.

This option can only be omitted when there is just one cluster in your environment.

When you have more than one compute cluster, you are required to provide which one to use through this option.

IF EXISTS

(Optional) To prevent the Upsolver query engine from returning an error if the table does not exist, include IF EXISTS in your DROP statement; instead, you will see the message Operation resulted in no change.

Example

The following example runs a DROP statement with IF EXISTS to drop the table, my_test_table. By including IF EXISTS, an error is not encountered if the table does not exist. Otherwise, if the table exists, it will be dropped from the organization:

DROP TABLE IF EXISTS "my_test_table" DELETE_DATA = FALSE;

The DELETE_DATA option is set to FALSE, so only the metadata is deleted, and the data is retained.

Last updated