How to query column metadata in BigQuery

Within a BigQuery table, I need to return from a query each column size and data type of this table. Is this possible ?

Upvotes: 0

Views: 2841

Answers (1)

Alfons Muñoz
Alfons Muñoz

Reputation: 519

You can view column data type with:

SELECT column_name,data_type FROM <MY_DATA_SET>.<MY_TABLE>.INFORMATION_SCHEMA.COLUMNS;

https://cloud.google.com/bigquery/docs/information-schema-tables

Upvotes: 1

Related Questions