Bigquery query to find the column names of a table

前端 未结 6 806
误落风尘
误落风尘 2021-01-17 08:59

I need a query to find column names of a table (table metadata) in Bigquery, like the following query in SQL:

SELECT column_name,data_type,data_length,data_p         


        
6条回答
  •  一生所求
    2021-01-17 09:41

    BigQuery now supports information schema.

    Suppose you have a dataset named MY_PROJECT.MY_DATASET and a table named MY_TABLE, then you can run the following query:

    SELECT column_name
    FROM MY_PROJECT.MY_DATASET.INFORMATION_SCHEMA.COLUMNS
    WHERE table_name = 'MY_TABLE'
    

提交回复
热议问题