DESCRIBE TABLE

DESCRIBE [TABLE] [db.]table describes the table structure in the db or the current database in-use.

Examples

Describes the table monitor:

sql

  1. DESCRIBE TABLE monitor;

or

sql

  1. DESCRIBE monitor;

Output:

sql

  1. +--------+----------------------+------+------+---------------------+---------------+
  2. | Column | Type | Key | Null | Default | Semantic Type |
  3. +--------+----------------------+------+------+---------------------+---------------+
  4. | host | String | PRI | YES | | TAG |
  5. | ts | TimestampMillisecond | PRI | NO | current_timestamp() | TIMESTAMP |
  6. | cpu | Float64 | | YES | 0 | FIELD |
  7. | memory | Float64 | | YES | | FIELD |
  8. +--------+----------------------+------+------+---------------------+---------------+
  9. 4 rows in set (0.00 sec)

It produces the table structure:

  • Column: the column names
  • Type: the column data types
  • Key: PRI means the column is in the primary key constraint.
  • Null: YES means nullable, otherwise NO
  • Default: default value or expression of the column
  • Semantic Type: This column represents the semantic type, corresponding to TAG, FIELD or TIMESTAMP in the data model.