BigQuery查询以查找表的列名 [英] Bigquery query to find the column names of a table

查看:227
本文介绍了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';

推荐答案

更新:现在可以这样做!请参见 INFORMATION SCHEMA文档和以下答案.

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.

您是否有理由将其作为查询进行?表元数据可通过表API 获得.

Is there a reason you need to do this as a query? Table metadata is available via the tables API.

这篇关于BigQuery查询以查找表的列名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆