Tables
Create new table asynchronously
Creates a new table in a bucket from one of the supported sources. The method of creating a table asynchronously should be used for larger imports (everything with 100 lines and more). The create request is created and added to a queue, the job resource url for status polling is returned.
The source is selected by the request body:
- CSV file – dataFileId of a file stored in File Uploads.
- Snapshot – snapshotId of a table snapshot; the table is created from the snapshot.
- Workspace – dataWorkspaceId together with dataObject (older dataTableName is deprecated). Load from a table or file in the workspace.
- Time travel – sourceTableId and timestamp (YYYY-MM-DD hh:mm:ss Z; time zone is required). Supported by Snowflake and BigQuery; BigQuery doesn't support primary keys, so the new table won't get primary keys.
Initial response returns job details JobResponse. The result of the asynchronous job can be fetched via /v2/storage/jobs/{id}. When the job completes, final result is TableCreateResponse.
Parameters of job will be TableCreateJobParams.
post/v2/storage/buckets/{id}/tables-async
Request
- Base URLhttps://connection.keboola.com
- Auth
- API key in header X-StorageApi-Token
- or API key in header X-KBC-ManageApiToken
- or HTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
idstring required
The bucket Id.
Headers
Request body
Example request
{
"name": "my-bucket",
"primaryKey": "id,name",
"distributionKey": "id"
}Response
Job accepted; returns job details.
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.