Repository navigation
createTable - Required parameter is missing #1422
Description
Activity
I believe this should work:
cliDataset.createTable(type, { schema: { fields: [ { type: 'string', name: 'type' }, { type: 'string', name: 'service' }, { type: 'string', name: 'uuid' }, { type: 'timestamp', name: 'created_at' }, { name: 'data', type: 'record', // <-- new fields: [ { type: 'string', name: 'favorite_flavor' } ] } ] } }, function(err, table, apiResponse) { // ... });
- addedtype: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.
on Jul 12, 2016 Okay, I figured out what I was doing wrong here. First, my table id was undefined since I was sending incorrect data to my API. However, in the process of tweaking things and trying to get this to work, I tried using the
idsub record as per #954 which does not seem to work yet. Additionally, sub-records need the 'record' type but using them is not documented in the API docs anywhere. Making those changes works now 👯@stephenplusplus thanks for the help!
Yeah, I think we can make this easier. We try to focus on the common use cases and decorate them to make things easier. This leaves holes where we link to the upstream API docs to show all of the options (https://cloud.google.com/bigquery/docs/reference/v2/tables#resource) from our docs (https://googlecloudplatform.github.io/gcloud-node/#/docs/v0.36.0/bigquery/dataset?method=createTable).
Making this easier should be pretty... easy. I'll re-open this issue and ping you when I have a PR, if you don't mind. Thanks for calling this out!
Sounds great, thanks!
- added a commit that references this issue
on Mar 27, 2026 - added a commit that references this issue
on May 5, 2026
I'm creating a table with an existing dataset like this:
This is the payload being sent to the
/tablesendpoint as I inspected it in the gcloud node library (pretty-printed):{ "schema": { "fields": [ { "type": "string", "name": "type" }, { "type": "string", "name": "service" }, { "type": "string", "name": "uuid" }, { "type": "timestamp", "name": "created_at" }, { "name": "data", "fields": [ { "name": "favorite_flavor", "type": "string" } ] } ] }, "tableReference": { "datasetId": "CLI", "projectId": "ionic-stats-storage" } }The API is returning a vague error about a missing required parameter, but doesn't say which one, and I believe I'm using the node API correctly (very possible I'm not). Note: I also tried removing the
datarecord in case I wasn't doing that properly, but I receive the same response: