Description

The SHOW CREATE TABLE command is used to obtain the creation statement of a specified table, external table, materialized view, or view. This section introduces how to use this command to get the creation statement of an external table.

Syntax

SHOW CREATE TABLE object_name;

Parameter Description

  • object_name: Specifies the name of the database object to query. This can be a table, materialized view, or view.

Usage Example

1. View the creation statement of a table

To view the creation statement of a table named t0, you can execute the following command:

SHOW CREATE TABLE new_pepole_delta;

After executing this command, the system will return an output similar to the following:

+-----------------------------------------------------------------+
|                               sql                               |
+-----------------------------------------------------------------+
| CREATE EXTERNAL TABLE ql_ws.`public`.new_pepole_delta(
  `id` int,
  `name` string,
  `dt` string)
PARTITIONED BY(`dt`)
USING delta
LOCATION "oss://function-compute-my1/delta-format/uploaddelta/"
CONNECTION ql_ws.oss_delta
COMMENT 'new_pepole_delta'; |
+-----------------------------------------------------------------+