如何添加“字符串数组"?作为BigQuery的架构值 [英] How to add "array of strings" as a schema value for BigQuery

查看:78
本文介绍了如何添加“字符串数组"?作为BigQuery的架构值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将字符串值数组存储在BigQuery的单个列中.为此,我需要先创建一个具有适当架构的表.数组的模式标识符为ARRAY<T>,其中T是数据类型.

I want to store an array of string values in a single column in BigQuery. In order to do that I need to first create a table with the proper schema. The schema identifier for the array is ARRAY<T> where T is the data type.

例如:TINT64替换为ARRAY<INT64>,可以在该列中存储64位整数数组.除了存储字符串值,我应该如何获得相同的效果?我已经尝试过STRINGVARCHARCHAR.

For example: T replaced by INT64 as ARRAY<INT64> enables the storage of 64-bit integer array in that column. How should I get this same effect but for storing string values? I have already tried STRING, VARCHAR and CHAR.

只需提及:我正在使用最新的google-cloud python软件包

Just mention: I am using latest google-cloud python package

文档参考BigQuery架构

推荐答案

为此,我需要首先使用适当的架构创建一个表.

In order to do that I need to first create a table with the proper schema.

只需在Web UI中使用新的目标表在下面运行-创建所需的架构

just run below in Web UI with new destination table - to create needed schema

#standardSQL
SELECT ARRAY<STRING>[] AS array_of_strings

这篇关于如何添加“字符串数组"?作为BigQuery的架构值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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