COLUMNS
Applies to: Databricks SQL
Databricks Runtime 10.2 and above
Unity Catalog only
INFORMATION_SCHEMA.COLUMNS describes columns of tables and views (relations) in the catalog.
The rows returned are limited to the relations the user is privileged to interact with.
Definition
The COLUMNS
relation contains the following columns:
Name |
Data type |
Nullable |
Standard |
Description |
---|---|---|---|---|
|
|
No |
Yes |
Catalog that contains the relation. |
|
|
No |
Yes |
Schema that contains the relation. |
|
|
No |
Yes |
Name of the relation the column is part of. |
|
|
No |
Yes |
Name of the column. |
|
|
No |
Yes |
The position (numbered from |
|
|
No |
Yes |
The default value used when the column is not specified in an INSERT, |
|
|
No |
Yes |
|
|
|
No |
Yes |
The simple data type name of the column, or |
|
|
No |
No |
The data type as specified in the column definition. |
|
|
Yes |
Yes |
Always |
|
|
Yes |
Yes |
Always |
|
|
Yes |
Yes |
For base-2 integral numeric types, |
|
|
Yes |
Yes |
For |
|
|
Yes |
Yes |
For integral numeric types 0, for |
|
|
Yes |
Yes |
For |
|
|
Yes |
Yes |
For |
|
|
Yes |
Yes |
Always |
|
|
Yes |
Yes |
Always |
|
|
No |
Yes |
Always ‘NO’, reserved for future use. |
|
|
Yes |
Yes |
Always |
|
|
Yes |
Yes |
Always |
|
|
Yes |
Yes |
Always |
|
|
Yes |
Yes |
Always |
|
|
Yes |
Yes |
Always |
|
|
Yes |
Yes |
Always |
|
|
Yes |
Yes |
Always |
|
|
Yes |
Yes |
Always |
|
|
No |
Yes |
Always |
|
|
No |
Yes |
Always |
|
|
Yes |
Yes |
Always |
|
|
No |
Yes |
|
|
|
Yes |
No |
Position (numbered from |
|
|
Yes |
No |
Optional description of the column. |
Constraints
The following constraints apply to the COLUMNS
relation:
Class |
Name |
Column List |
Description |
---|---|---|---|
Primary key |
|
|
Unique identifier for the column. |
Unique key |
|
|
Unique identifier the column. |
Foreign key |
|
|
References TABLES. |