📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

SHOW VIRTUAL COLUMNS



Shows the created virtual columns in the system. Equivalent to SELECT * FROM system.virtual_columns.

Virtual columns are enabled by default starting from v1.2.832.

See also: system.virtual_columns

Preferred Syntax

Use the command in its simplest, most useful form to inspect a specific table or list all virtual columns:

SHOW VIRTUAL COLUMNS [WHERE table = '<table_name>' AND database = '<database_name>']

Example

CREATE TABLE test(id int, val variant); INSERT INTO test VALUES ( 1, '{"id":1,"name":"datalake"}' ), ( 2, '{"id":2,"name":"databricks"}' ); SHOW VIRTUAL COLUMNS WHERE table = 'test' AND database = 'default'; ╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ │ database │ table │ source_column │ virtual_column_id │ virtual_column_name │ virtual_column_type │ │ String │ String │ String │ UInt32 │ String │ String │ ├──────────┼────────┼───────────────┼───────────────────┼─────────────────────┼─────────────────────┤ │ default │ test │ val │ 3000000000 │ ['id'] │ UInt64 │ │ default │ test │ val │ 3000000001 │ ['name'] │ String │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────╯

Was this page helpful?