Tables

Import data asynchronously

Imports data into an existing table from a CSV file or from a workspace. The source is selected by the request body.

From a CSV file

The actual data must be provided in dataFileId. An imported file can be sliced into multiple chunks; the conditions described in File Uploads must be satisfied. The CSV file can be raw or gzipped. Gzipped files must have the extension .gz. A typical asynchronous import negotiation consists of these steps:

  1. Upload a CSV file using File Upload.
  2. Submit an asynchronous import request with dataFileId set to the File ID returned in the previous step.
  3. Poll job resource returned in the previous step until the status is success or error.

Specific behavior of BigQuery: if the treatValuesAsNull parameter is an empty array in the request, no values will be converted to NULL.

From a workspace

The actual data must be provided in dataWorkspaceId and dataObject (older dataTableName is deprecated). Import from table and file workspace is supported.

  • For table workspace use dataWorkspaceId and set dataObject with name of source table.
  • For file workspace use dataWorkspaceId and dataObject can be a single file file.csv, a folder folder/ (mind the trailing slash) or a manifest file.csvmanifest.
  • For file workspace always use columns[] attribute with list of imported columns.

Further information can be found in the Developers Documentation.

post/v2/storage/tables/{id}/import-async

Request

Path parameters

idstring required

Target table ID.

Headers

contextstring nullable

Request body

OR

Example request

{
  "dataFileId": 12345,
  "treatValuesAsNull": [
    ""
  ],
  "columns": [
    "id",
    "name"
  ],
  "enclosure": "\"",
  "delimiter": ","
}

Response

Import job accepted; returns job details.

idstring required

Job ID.

statusstring required

Current status of the job.

urlstring required

API detail URL for the job.

tableIdstring nullable required

ID of the table affected by the job.

operationNamestring required

Type of operation performed.

operationParamsobject required

Parameters for the operation.

createdTimestring date-time required

Job creation timestamp.

startTimestring date-time nullable required

Job start timestamp.

endTimestring date-time nullable required

Job end timestamp.

runIdstring nullable required

Run ID for the job.

Example response

{
  "id": "22077337",
  "status": "waiting",
  "url": "https://connection.keboola.com/v2/storage/jobs/22077337",
  "tableId": null,
  "operationName": "workspaceLoad",
  "operationParams": {
    "workspaceId": "78423",
    "preserve": false,
    "input": [
      {
        "source": "in.c-application-testing.cashier-data",
        "destination": "my-table"
      }
    ],
    "queue": "main_fast"
  },
  "createdTime": "2017-02-13T16:41:18+0100",
  "startTime": null,
  "endTime": null,
  "runId": null,
  "results": null,
  "creatorToken": {
    "id": "27978",
    "description": "john.doe@keboola.com"
  },
  "actor": {
    "type": "token",
    "id": "27978",
    "name": "john.doe@keboola.com",
    "adminId": 1234
  },
  "metrics": {
    "inCompressed": false,
    "inBytes": 0,
    "inBytesUncompressed": 0,
    "outCompressed": false,
    "outBytes": 0,
    "outBytesUncompressed": 0
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.