GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — createTable - Required parameter is missing · Issue #1422 · googleapis/google-cloud-node

createTable - Required parameter is missing #1422

New issue
Copy link
New issue
Copy link
Closed
Closed
createTable - Required parameter is missing#1422
Copy link
Assignees
mlynch
Labels
api: bigqueryIssues related to the BigQuery API.type: questionRequest for information or clarification. Not an issue.

Description

@mlynch
mlynch
opened on Jul 12, 2016
Issue body actions

I'm creating a table with an existing dataset like this:

var bigquery = gcloud.bigquery({
  projectId: 'ionic-stats-storage',
  keyFilename: './bigquery.json'
});

var cliDataset = bigquery.dataset('CLI');
cliDataset.createTable(type, {
        schema: {
          fields: [
            { type: 'string', name: 'type' },
            { type: 'string', name: 'service' },
            { type: 'string', name: 'uuid' },
            { type: 'timestamp', name: 'created_at' },
            { name: 'data', fields: fields }
          ]
        }
      }, function(err, table, apiResponse) {
...
});

This is the payload being sent to the /tables endpoint 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 data record in case I wasn't doing that properly, but I receive the same response:

{ ApiError: Required parameter is missing
    at new util.ApiError (/Users/max/git/ionic-track/node_modules/gcloud/lib/common/util.js:106:10)
    at Object.parseHttpRespBody (/Users/max/git/ionic-track/node_modules/gcloud/lib/common/util.js:184:30)
    at Object.handleResp (/Users/max/git/ionic-track/node_modules/gcloud/lib/common/util.js:124:18)
    at /Users/max/git/ionic-track/node_modules/gcloud/lib/common/util.js:447:12
    at Request.onResponse [as _callback] (/Users/max/git/ionic-track/node_modules/retry-request/index.js:120:7)
    at Request.self.callback (/Users/max/git/ionic-track/node_modules/request/request.js:187:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/Users/max/git/ionic-track/node_modules/request/request.js:1044:10)
    at emitOne (events.js:96:13)
  code: 400,
  errors:
   [ { domain: 'global',
       reason: 'required',
       message: 'Required parameter is missing' } ],
  response: undefined,
  message: 'Required parameter is missing' }

Activity

  1. mlynch
    closed this as completedon Jul 12, 2016
  2. stephenplusplus commented on Jul 12, 2016

    @stephenplusplus
    stephenplusplus
    on Jul 12, 2016
    Contributor
    More actions

    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) {
      // ...
    });
  3. stephenplusplus
    added
    type: questionRequest for information or clarification. Not an issue.
    api: bigqueryIssues related to the BigQuery API.
    on Jul 12, 2016
  4. mlynch commented on Jul 12, 2016

    @mlynch
    mlynch
    on Jul 12, 2016
    Author
    More actions

    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 id sub 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!

  5. stephenplusplus commented on Jul 12, 2016

    @stephenplusplus
    stephenplusplus
    on Jul 12, 2016
    Contributor
    More actions

    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!

  6. stephenplusplus
    reopened this on Jul 12, 2016
  7. stephenplusplus
    added
    enhancement
    on Jul 12, 2016
  8. mlynch commented on Jul 12, 2016

    @mlynch
    mlynch
    on Jul 12, 2016
    Author
    More actions

    Sounds great, thanks!

  9. callmehiphop
    closed this as completedin #1564on Sep 7, 2016
  10. JustinBeckwith
    assigned
    mlynch
    on Feb 1, 2021
  11. GautamSharda
    added 2 commits that reference this issue on Mar 23, 2026

    fix: Remove custom readrows retry logic and rely on gax for retries (#…

    64b1570

    fix: Remove custom readrows retry logic and rely on gax for retries (#…

    05069b5
  12. shivanee-p
    added a commit that references this issue on Mar 27, 2026

    fix: Remove custom readrows retry logic and rely on gax for retries (#…

    3e83417
  13. thiyaguk09
    added a commit that references this issue on May 5, 2026

    fix: Remove custom readrows retry logic and rely on gax for retries (g…

    fa8d2fa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @mlynch
    mlynch

Labels

api: bigqueryIssues related to the BigQuery API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402792 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.