将包含重复字段的结果集保存到目标表 [英] Save a result set containing repeated field to a destination table

查看:24
本文介绍了将包含重复字段的结果集保存到目标表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将以下查询的结果集保存到表中.

I would like to save the result set of the following query to a table.

SELECT

g, NEST(x) AS a

FROM 

(SELECT 1 AS g, 10 AS x), (SELECT 1 AS g, 20 AS x), (SELECT 1 AS g, 30 AS x), 
(SELECT 2 AS g, 100 AS x), (SELECT 2 AS g, 200 AS x)  

GROUP BY g

我使用带有如果为空则写入"、允许大结果:是"、展平结果:否"和查询优先级:交互式"选项的网络查询编写器.我不想扁平化查询结果.

I use the web query composer with the options "Write if empty", "Allow Large Results: yes", "Flatten Results: no" and "Query priority: Interactive". I don't want to flatten query results.

查询失败:错误:意外.请重试."

当我使用以下架构创建表并选择附加到表"选项时,我收到了同样的错误.

When I created a table with the following schema and selected the option "Append to table", I received the same error.

{
    "fields": [
        {
            "name": "g",
            "type": "integer"
        },
        {
            "name": "a",
            "type": "integer",
            "mode": "repeated"
        }
    ]
}

感谢您的建议.

推荐答案

这是一个已知问题,NEST 函数和 flattenResults 设置为 false:这两个不是目前相互兼容.我们想解决这个问题,但我没有预计到达时间,因为根本问题很重要.

This is a known issue with the NEST function and flattenResults set to false: the two aren't compatible with each other at present. We'd like to fix this but I don't have an ETA as the underlying issue is nontrivial.

如果您有一个带有重复字段的现有表,您应该能够成功SELECT它并使用将flattenResults设置为false将其作为重复字段输出.

If you have an existing table with a repeated field, you should be able to successfully SELECT it and output it as a repeated field using flattenResults set to false.

这篇关于将包含重复字段的结果集保存到目标表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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