DROP EXTERNAL TABLE
Drops an external table and its underlying files from an external data source mapped to Hologres through an external database. Available in Hologres V3.0 and later, this statement supports only Apache Paimon tables in Data Lake Formation (DLF) 2.0.
Executing this statement permanently deletes the table and its files from the external data source. Proceed with caution.
Prerequisites
Make sure the following conditions are met:
-
Your Hologres instance runs V3.0 or later.
-
You have the CONNECT permission on the external database that contains the target table.
-
You have the permission to drop tables in DLF 2.0. For more information, see the DLF 2.0 Permission Management documentation
Syntax
DROP EXTERNAL TABLE [IF EXISTS] <ext_db_name>.<ext_schema_name>.<ext_table_name>;
Parameters
| Parameter | Description |
|---|---|
IF EXISTS |
Optional. Prevents the statement from returning an error if the table does not exist. |
<ext_db_name> |
The name of the external database. |
<ext_schema_name> |
The name of the external schema. |
<ext_table_name> |
The name of the external table to drop. |
Specify the table using a fully qualified three-part name in the format ext_db.ext_schema.ext_table. Partial names are not supported.
Usage notes
-
Each statement drops only one table. To drop multiple tables, run separate statements.
Examples
In the following examples, replace ext_db_dlf, ext_schema_dlf, and ext_table_dlf with your actual external database, schema, and table names.
Drop an external table. Use the IF EXISTS clause to prevent errors if the table does not exist:
DROP EXTERNAL TABLE IF EXISTS ext_db_dlf.ext_schema_dlf.ext_table_dlf;
Drop an external table without the IF EXISTS clause:
DROP EXTERNAL TABLE ext_db_dlf.ext_schema_dlf.ext_table_dlf;
See also
-
CREATE EXTERNAL TABLE
-
ALTER EXTERNAL TABLE