有没有办法将嵌套记录选择到表中? [英] Is there a way to select nested records into a table?

查看:91
本文介绍了有没有办法将嵌套记录选择到表中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Bigquery中有一个表T,它包含简单字段和一个嵌套字段。



我想有效地select * from T where ... 并将结果存储在一个新表U.



我希望U具有与T相同的模式(包括嵌套字段)。



有没有一种方法可以在Bigquery中执行此操作,或者是导出/变换/导入的解决方案?

默认情况下,所有查询结果都会变平,但我们已经为查询添加了一个展平结果标志,如果您想要嵌套结果,可以将其设置为false。目前仅当您选择目标表并使用允许大量结果时才有效。如果您使用的是Web UI,则可以通过单击查询窗口中的显示选项按钮来使用此设置。如果您正在调用API,则可以在查询作业配置中设置flattenResults = False。



此功能的文档为 here


I have a table, T, in Bigquery which contains simple fields and one nested field.

I would like to effectively "select * from T where ..." and store the result in a new table U.

I want U to have the same schema as T (including the nested field).

Is there a way to do this within Bigquery or is the solution to export/transform/import?

解决方案

All query results get flattened by default, but we've added a "flatten results" flag to the query that you can set to false if you want nested results. This currently only works when you select a destination table and use "allow large results". If you're using the Web UI, this setting is available by clicking on the "show options" button on the query window. If you're calling the API, you can set "flattenResults=False" in the query job configuration.

Docs for this feature are here.

这篇关于有没有办法将嵌套记录选择到表中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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