Vikram Tiwari Vikram Tiwari - 3 years ago 87
Python Question

How to add "array of strings" as a schema value for BigQuery

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.

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
.

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

Documentation Reference for BigQuery Schema

Answer Source

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

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

#standardSQL
SELECT ARRAY<STRING>[] AS array_of_strings
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download