DROP EXTERNAL SCHEMA

Updated at:

In Hologres V3.0 and later, you can drop an external schema from an external database whose data source is DLF 2.0.

Note

An external schema in Hologres corresponds to an entity object in an external data source, such as a database in DLF 2.0. Dropping an external schema also drops the corresponding database and its tables. Proceed with caution.

Limitations

To run this command, you must have the CONNECT permission on the external database and permission to delete resources in the corresponding catalog in DLF 2.0. For more information, see DLF 2.0 permission management.

Syntax

DROP EXTERNAL SCHEMA [IF NOT EXISTS] <ext_database_name>.<ext_schema_name>;

Example

  1. Create a catalog in the DLF console. For more information, see DLF 2.0 catalog.

    Set Catalog type to Paimon, set Catalog name to dlf_catalog, accept the service agreement, and click Create Catalog.

    After the catalog is created, you can find the Paimon catalog named dlf_catalog in the Catalogs list with a status of running.

  2. Create an external database in Hologres to map the catalog in DLF. For more information, see CREATE EXTERNAL DATABASE.

    CREATE EXTERNAL DATABASE ext_db_dlf
    WITH 
      metastore_type 'dlf-rest'  
      catalog_type 'paimon'
      dlf_catalog 'dlf_catalog';
  3. Create a schema in the external database in Hologres. For more information, see CREATE EXTERNAL SCHEMA.

    CREATE EXTERNAL SCHEMA ext_db_dlf.ext_schema_dlf;
  4. Drop the external schema in Hologres.

    DROP EXTERNAL SCHEMA ext_db_dlf.ext_schema_dlf;