BigQuery中的部分JSON模式 [英] partial JSON schema in BigQuery

查看:99
本文介绍了BigQuery中的部分JSON模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含很多字段的JSON文件。我不想将它们全部导入到我的表格中。
假设有一个包含数百个字段的JSON文件,但我只想在BigQuery中查看它。请问有人能给我举个例子吗?
当我仅输入模式的一部分时,出现错误。

I have a JSON file with a lot of fields. I don't want to import all of them into my table. Let's say there is a JSON file which has hundreds fields, but I only want to make a small view of it in BigQuery. Could somebody give me an example how to do that please? When I input only part of the schema, I get errors.

推荐答案

如果您没有嵌套/重复的字段,你想保留,你可以加载整个事情,并运行一个查询,只选择你想保留的字段,并将结果保存为一个新表(你会想要使用'允许大量结果'选项)。

If you don't have nested/repeated fields that you want to preserve, you could just load the entire thing and run a query to select only the fields that you want to keep and save the results as a new table (you'll want to use the 'allow large results' option for this one).

或者,您可以只保留表格中的所有字段。您仍然支付所有这些费用,但是您不会为查询费用付费(除非您实际上对他们进行了查询,这意味着他们可能无论如何都是有价值的)。

Alternately, you could just keep all of the fields in the table. You'll still pay for storing all of them, but you won't pay for querying them (unless you actually do query against them, which means they were probably valuable to keep around anyway).

这篇关于BigQuery中的部分JSON模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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