Updated on 2022-11-18 GMT+08:00

CREATE VIRTUAL SCHEMA

CREATE/DROP/SHOW VIRTUAL SCHEMA(S)

  • CREATE

    The CREATE statement in HetuEngine is used to create a schema mapping and open the local domain data source to external systems based on the mapping information.

    The syntax is as follows:

    CREATE VIRTUAL SCHEMA [ IF NOT EXISTS ] schema_name WITH ( [catalog = ctlg_name,] schema = schm_name, [property_name = expression, ...] ) 

    To create a virtual schema, provide the schema information in WITH. WITH and schema are mandatory. The catalog parameter is optional. If catalog is not specified, the catalog in the current session is used.

    Example statement:

    CREATE VIRTUAL SCHEMA hive_default WITH (catalog = 'hive', schema = 'default');
  • DROP

    The DROP statement in HetuEngine is used to delete a schema mapping.

    The syntax is as follows:

    DROP VIRTUAL SCHEMA [ IF EXISTS ] schema_name 

    Example statement:

    DROP VIRTUAL SCHEMA hive_default;
  • SHOW

    The SHOW statement in HetuEngine is used to query all schema mappings.

    The syntax is as follows:

    SHOW VIRTUAL SCHEMAS [ FROM catalog ] [ LIKE pattern ] 

    Example statement:

    SHOW VIRTUAL SCHEMAS;