jsongoogle-bigqueryinsert-id

Request Body in BigQuery


Good Day,

I am testing a post method in another system using BigQuery as its data source. I am currently testing the call method on BigQuery's live data to see if the API request gets a response.

What I want to know is: is the insertId meant to be the column I want to target and, in this case, the Client ID and the JSON object should have all the data within that Column ID?

  "kind": "bigquery#tableDataInsertAllRequest",
  "skipInvalidRows": false,
  "ignoreUnknownValues": false,
  "rows": [
    {
      "insertId": "ClientID",
      "json": {
        "ClientID": "55415",
        "Client": "LANGA BRANCH",
        "Project": "Customer Visits",
        "Developer": "Bryan",
        "Hours": "300"
      }
    }
  ]
}```


Solution

  • The insertId is an optional field. It can (and probably should) be omitted entirely, as it's used on a best effort basis for deduplication. Omitting it yields higher throughput: https://cloud.google.com/bigquery/quotas#streaming_inserts_without_insertid_fields

    The REST reference for insertAll is here: https://cloud.google.com/bigquery/docs/reference/rest/v2/tabledata/insertAll