首页 > 解决方案 > 如何正确使用变量 ARRAY>

问题描述

我正在尝试将结果集存储到结构数组中,但它没有按我的预期工作。也许有人知道出了什么问题。我没有任何错误消息。

declare rs ARRAY<STRUCT<created_date TIMESTAMP, unique_key STRING, complaint_description STRING>>;

SET rs = 
(
    ARRAY (
            SELECT AS STRUCT created_date, unique_key, complaint_description
            FROM `bigquery-public-data.austin_311.311_service_requests`
            LIMIT 10
          )
);

select * from unnest(rs);

标签: google-bigquery

解决方案


推荐阅读