Updated on 2025-08-25 GMT+08:00

CREATE SCHEMA

Function

CREATE SCHEMA is specific to DataArts Fabric SQL. It is used to create a database with a specified name on LakeFormation.

Precautions

DataArts Fabric SQL does not have the cluster concept and does not store any metadata. All metadata is stored in LakeFormation. Therefore, after creating an external schema, you can log in to the LakeFormation console to view the created metadata.

Syntax

1
CREATE SCHEMA [ IF NOT EXISTS ] schema_name [ WITH LOCATION path ];

Parameter Description

  • schema_name

    Database name of the target table.

  • WITH LOCATION path

    (Optional) Database storage directory. If no database directory is specified by the user, the system will automatically use the database directory with the same name as the storage directory of the database in the catalog directory.

  • path

    Path for storing database files. When creating a schema, ensure that the target path does not contain other files.

Examples

Create a database directory.

1
CREATE SCHEMA test_schema;

Create a database directory and specify a storage directory for the database.

1
CREATE SCHEMA test_schema WITH LOCATION 'obs://xxxxx/yyyy/';