Is it possible to add a new field to an existing field of RECORD type in bigquery? So for example if my current schema is :
{u\'fields\': [{u\'mode\': u\'NULLABL
This can be done totally from within UI using respective API Explorers
First, you need to get schema of your table. You can do this using Tables.get API Explorer. Make sure you select/check schema in fields
box (better to leave the rest unchecked). Click Authorize and Execute
. When done - Copy response text - it will look somehow like below
{
"schema": {
"fields": [
{
"name": "id",
"type": "STRING",
"mode": "NULLABLE"
},
...
{
"name": "comment",
"type": "STRING",
"mode": "NULLABLE"
}
]
}
}
Then, use Tables.patch API Explorer
Add needed fields(s) into previously retrieved schema and paste it as is into Patch Body
box (chose freeform editor in the right-top corner of this box and just replace whatever inside with your schema's text). Again click Authorize and Execute
You done now.
Note that no matter where you put your new field within record - it will be added to the end of this record fields
Btw, alternatively, you can use standalone Explorers
Services > BigQuery API v2
The ones that we used here are bigquery.jobs.get
and bigquery.tables.patch