Schema SQL Grammar

Schema support the listed SQL grammar for DDL workloads.

AI Data Platform supports all standard Spark SQL data types. For more information, see Apache Spark Documentation - Supported Data Types.

Table 22-2 List of Schema SQL Grammar

Operation Grammar
Create Schema
CREATE SCHEMA [IF NOT EXISTS] catalog_name.schema_name

Response

<<SQL Command>> was successfully executed

Error

Error: <<SQL Command>> failed due to <<reason>>
Alter Schema
Alter Schema Description
ALTER SCHEMA <schema-name> set dbproperties (DESCRIPTION=<property-value>)
Response
<<SQL Command>> was successfully executed
Error
Error: <<SQL Command>> failed due to <<reason>>
Delete Schema
DROP SCHEMA [ IF EXISTS ] <<schema_name>>

By default during DROP schema, all child objects will also get deleted

List Schemas
SHOW SCHEMAS [ { FROM | IN } catalog_name ] [ [ LIKE ] regex_pattern ]
Examples:
  • SHOW SCHEMAS FROM defaultcatalog1 LIKE 'd*'
  • SHOW SCHEMAS IN defaultcatalog1 LIKE 'd*'
Response:
  Schema
1 <<schema_1>>
2 <<schema_2>>
2 <<schema_3>>

Error

Error: <<SQL Command>> failed due to <<reason>>
Describe Schema (get details)

DESCRIBE SCHEMA <<catalog_name>>.<<schema_name>>

DESCRIBE SCHEMA <<schema_name>>

DESCRIBE SCHEMA <<schema_name>> in Catalog <<catalog_name>>

Attribute Value
Catalog name Catalog name
Schema Schema name
Description Schema description
Created by User that created the catalog
Created on Date and time created
Updated by User that last updated the catalog
Updated on Date and time last updated
Location Location in the catalog
Drop Schema drop schema [ IF EXISTS ] <<schema_name>> cascade