BigQuery NEST()返回'错误:发生内部错误' [英] BigQuery NEST() returns 'Error: An internal error occurred'

查看:86
本文介绍了BigQuery NEST()返回'错误:发生内部错误'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我试图在BigQuery UI中嵌套一个字段(而不是API),并在尝试输出到表时不断拼错: blockquote>

错误:发生内部错误,并且请求无法完成。

我使用 NEST()功能,并尝试过这在公共莎士比亚数据集上,并继续得到相同的错误。

 选择语料库,NEST(字)FROM [publicdata:samples .shakespeare] GROUP BY 1 

我的工作ID是:realself-main:bquijob_1bfb8310_153583ecbc2

解决方案

有很多关于SO的问题,涉及如何在BigQuery中生成重复的文件/记录
并且有许多不同的答案 - 范围



来自:NEST与不结实的结果不兼容 - 如在
NEST时出现内部错误,不能展平结果



改为:使用JS UDF解决此问题的一些解决方案,如
嵌套在BigQuery中的多个重复字段;

创建一个包含记录类型列表的表格;

创建一个列类型为RECORD的表格



还有更多 - 您可以搜索


但令人惊讶的是 - 最近,我发现使NEST()工作几乎可以发挥作用!


请在下面尝试看到这个把戏

 选择语料库,单词
FROM(
)选择语料库,NEST(单词)AS单词
FROM [publicdata:samples.shakespeare]
GROUP BY 1
)作为
CROSS JOIN(选择1)由于b

请注意,您必须使用允许大型结果开始和展平结果关闭


I'm trying to nest a field in the BigQuery UI (not the API) and continually get hit with an error when trying to output to a table without flattening:

Error: An internal error occurred and the request could not be completed.

I'm using the NEST() function and I've tried this on the public Shakespeare dataset and continue to get the same error.

SELECT corpus, NEST(word) FROM [publicdata:samples.shakespeare] GROUP BY 1

My Job ID is: realself-main:bquijob_1bfb8310_153583ecbc2

解决方案

There were tons of question on SO related to how to generate repeated fileds/records in BigQuery And, there were many different answers - ranging

from: NEST is not compatible with unflatten result - as in
Internal error on NEST when not flattening results

to: some solutions to address this issue using JS UDF as in
Nest multiple repeated fields in BigQuery ;
Create a table with Record type column ;
create a table with a column type RECORD

there are more - you can search

But surprisingly enough - recently, I found how to make NEST() work almost as it supposed to work!

Try below to see the trick

SELECT corpus, words 
FROM (
  SELECT corpus, NEST(word) AS words
  FROM [publicdata:samples.shakespeare] 
  GROUP BY 1
) AS a
CROSS JOIN (SELECT 1) AS b

Note, you have to write result to table with Allow Large Results on and Flatten Results off

这篇关于BigQuery NEST()返回'错误:发生内部错误'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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