Bigquery 查询以查找表的列名 [英] Bigquery query to find the column names of a table
本文介绍了Bigquery 查询以查找表的列名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要一个查询来在 Bigquery 中查找表(表元数据)的列名,就像 SQL 中的以下查询:
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_precision,nullable FROM all_tab_cols where table_name ='EMP';
推荐答案
更新:现在可以了!请参阅信息架构
文档和答案如下.
Update: This is now possible! See the INFORMATION SCHEMA
docs and the answers below.
答案,大约在 2012 年:
目前无法通过查询检索表元数据(即列名和类型),尽管这不是第一次被请求.
It's not currently possible to retrieve table metadata (i.e. column names and types) via a query, though this isn't the first time it's been requested.
您是否有理由需要将此作为查询?表元数据可通过 tables API 获得.
Is there a reason you need to do this as a query? Table metadata is available via the tables API.
这篇关于Bigquery 查询以查找表的列名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文