共用方式為


DESCRIBE SCHEMA

適用於: 核取記號為「是」Databricks SQL 核取記號為「是」Databricks Runtime

傳回現有架構的元數據。 元數據資訊包括檔案系統上的架構名稱、批註和位置。 如果指定了選擇性 EXTENDED 選項,也會傳回架構屬性。

雖然 和 SCHEMA DATABASE 的使用是可互換的, SCHEMA 但偏好使用 。

語法

{ DESC | DESCRIBE } SCHEMA [ EXTENDED ] schema_name

參數

  • schema_name:系統中現有架構的名稱。 如果名稱不存在,則會擲回例外狀況。

範例

-- Create employees SCHEMA
> CREATE SCHEMA employees COMMENT 'For software companies';

-- Describe employees SCHEMA.
-- Returns Database Name, Description and Root location of the filesystem
-- for the employees SCHEMA.
> DESCRIBE SCHEMA employees;
 database_description_item    database_description_value
 ------------------------- -----------------------------
             Database Name                     employees
               Description        For software companies
                  Location file:/you/Temp/employees.db

-- Create employees SCHEMA
> CREATE SCHEMA employees COMMENT 'For software companies';

-- Alter employees schema to set DBPROPERTIES
> ALTER SCHEMA employees SET DBPROPERTIES ('Create-by' = 'Kevin', 'Create-date' = '09/01/2019');

-- Describe employees SCHEMA with EXTENDED option to return additional schema properties
> DESCRIBE SCHEMA EXTENDED employees;
 database_description_item                    database_description_value
 ------------------------- ---------------------------------------------
             Database Name                                     employees
               Description                        For software companies
                  Location                 file:/you/Temp/employees.db
                Properties ((Create-by,kevin), (Create-date,09/01/2019))

-- Create deployment SCHEMA
> CREATE SCHEMA deployment COMMENT 'Deployment environment';

-- Describe deployment.
> DESCRIBE SCHEMA deployment;
 database_description_item database_description_value
 ------------------------- ------------------------------
             Database Name                     deployment
               Description         Deployment environment
                  Location file:/you/Temp/deployment.db