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

ByteHouse Cloud Data Warehouse Version

Copy page
Download PDF
System tables
system.columns
Copy page
Download PDF
system.columns

The System table system.columns contains information about all Columns, including each Column's Type, Location, key associations, compression State, and other Metadata. It can be used to view table structure details and for Analysis of Column storage characteristics.

Column name

| | | | \

NameData typeDescription
\
databaseStringThe name of the Database to which the Column belongs.
\
tableStringThe name of the table to which the Column belongs.
\
nameStringThe name of the Column.
\
typeStringThe data type of the Column.
\
positionUInt64The Column's position in the table, starting from 1.
\
default_kindStringThe expression type of the Column's default value. Possible values are DEFAULT, MATERIALIZED, and ALIAS. If undefined, it is an empty string.
\
default_expressionStringThe specific expression for the Column's default value. If undefined, it is an empty string.
\
data_compressed_bytesUInt64The size of the Column's compressed data, in bytes.
\
data_uncompressed_bytesUInt64The size of the Column's uncompressed data, in bytes.
\
marks_bytesUInt64The size of the Column's mark data, in bytes.
\
commentStringThe comment text for the Column. If not defined, it is an empty string.
\
is_in_partition_keyUInt8Indicates whether the Column is included in the table's partition key expression:\
\
* 1 = Yes (participates in partition logic);\
* 0 = No.
\
is_in_sorting_keyUInt8Indicates whether the Column is included in the table's sorting key expression:\
\
* 1 = Yes (participates in data sorting);\
* 0 = No.
\
is_in_primary_keyUInt8Indicates whether the Column is included in the table's primary key expression:\
\
* 1 = Yes (used to uniquely identify data rows);\
* 0 = No.
\
is_in_sampling_keyUInt8Indicates whether the Column is included in the table's sampling key expression:\
\
* 1 = Yes (participates in data sampling logic);\
* 0 = No.
\
compression_codecStringThe name of the compression codec used by the Column.
\
character_octet_lengthNullable(UInt64)The maximum length of binary data, character data, text data, or images, in bytes. In ByteHouse, this is only valid for the FixedString data type; other types return NULL.
\
numeric_precisionNullable(UInt64)The precision of approximate numeric data, exact numeric data, integer data, or currency data. In ByteHouse, it is the bit width of integer types, and the decimal precision of Decimal types; other types return NULL.
\
numeric_precision_radixNullable(UInt64)The radix of the number system, indicating the precision of approximate numeric data, exact numeric data, integer data, or currency data. In ByteHouse, integer types use 2, Decimal types use 10; other types return NULL.
\
numeric_scaleNullable(UInt64)The scale of approximate numeric data, exact numeric data, integer data, or currency data. In ByteHouse, only the Decimal type is meaningful; other types return NULL values.
\
datetime_precisionNullable(UInt64)The decimal precision of the DateTime64 data type. Other data types return NULL values.

Example

Query column information in the sales_db.order_details table, and only retrieve key fields:

SELECT 
  name AS column_name, 
  type AS column_type, 
  is_in_primary_key, 
  is_in_partition_key, 
  default_kind 
FROM system.columns 
WHERE database = 'sales_db' 
  AND table = 'order_details' 
ORDER BY position;

Example of query results:
Image

Last updated: 2026.03.31 16:16:45