CREATE ENTITY

Syntax

CREATE ENTITY fully_qualified_entity_name;

Description

This command creates a new entity supported by a Store. These entities can then be used to host Relations created through DDL or Query.

The entities created by this command can be listed using the LIST ENTITIES command.

Arguments

fully_qualified_entity_name

The full name of the entity to create.

Examples

Create a Snowflake database

demodb.public/sfstore# CREATE ENTITY "DELTA_STREAMING";
demodb.public/sfstore# LIST ENTITIES;
       Entity name       
-------------------------
  DELTA_STREAMING        
  SNOWFLAKE              
  SNOWFLAKE_SAMPLE_DATA  

Create a Snowflake schema in a database

In this example we create a new schema within the existing DELTA_STREAMING Snowflake database:

demodb.public/sfstore# CREATE ENTITY "DELTA_STREAMING"."MY_STREAMING_SCHEMA";
demodb.public/sfstore# LIST ENTITIES IN "DELTA_STREAMING";
      Entity name      
-----------------------
  INFORMATION_SCHEMA   
  MY_STREAMING_SCHEMA  
  PUBLIC               

Create a Databricks catalog

demodb.public/databricks_store# CREATE ENTITY cat1;
demodb.public/databricks_store# LIST ENTITIES;
        Entity name
---------------------------
  cat1
  main
  system

Create a Databricks schema in a catalog

In this example we create a new schema within the existing DELTA_STREAMING Snowflake database:

demodb.public/databricks_store# CREATE ENTITY cat1.schema1;
demodb.public/databricks_store# LIST ENTITIES IN cat1;
     Entity name
----------------------
  default
  information_schema
  schema1 

Last updated