You need to enable JavaScript to run this app.
ByteHouse Cloud Data Warehouse Version

ByteHouse Cloud Data Warehouse Version

Copy page
Download PDF
DDL
Describe statement (DESCRIBE)
Copy page
Download PDF
Describe statement (DESCRIBE)

DESCRIBE returns the column definition of the table.
Syntax

DESC|DESCRIBE TABLE [db.]table [INTO OUTFILE filename] [FORMAT format]

The DESCRIBE statement returns one row for each table column, containing the following string values:

  • name — column name.
  • type — column type.
  • default_type — the clause used in the column default expression: DEFAULT, MATERIALIZED, or ALIAS. If there is no default expression, then returns an empty string.
  • default_expression — the expression specified after the DEFAULT clause.
  • comment — column comment.
  • codec_expression — the encoding applied to this column.
  • ttl_expression — TTL expression.
  • is_subcolumn — for internal subcolumns, the value is 1. This flag is only included in the result when subcolumn description is enabled by passing the describe_include_subcolumns setting.

Example

-- create a table 
CREATE TABLE describe_example ( 
    id UInt64, text String DEFAULT 'unknown' CODEC(ZSTD), 
    user Tuple (name String, age UInt8) 
) ENGINE = CnchMergeTree() ORDER BY id; 

-- returns the definition of columns in the table 
DESCRIBE TABLE describe_example; 
┌─name─┬─type──────────────────────────┬─default_type─┬─default_expression─┬─comment─┬─codec_expression─┬─ttl_expression─┐ 
│ id   │ UInt64                        │              │                    │         │                  │                │ 
│ text │ String                        │ DEFAULT      │ 'unknown'          │         │ ZSTD(1)          │                │ 
│ user │ Tuple(name String, age UInt8) │              │                    │         │                  │                │ 
└──────┴───────────────────────────────┴──────────────┴────────────────────┴─────────┴──────────────────┴────────────────┘
Last updated: 2026.03.31 10:31:07