Skip to content

Recover deleted table

Request

Recovers a deleted table. If the parent database is also deleted, with proper permissions it will be recovered automatically.

Security
ApiKeyAuth
Path
table_idinteger(TableId)required
Example:11
Bodyapplication/json
table_namestring(name)

Alternative name for the recovered table to avoid conflicts with existing tables

Example:"Bravo"
database_namestring(name)

Alternative name for the recovered parent database to avoid conflicts with existing databases

Example:"Alpha"
curl -i -X POST \
  https://api.treasuredata.com/v3/table/recover/11 \
  -H 'Authorization: TD1 <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "table_name": "Bravo",
    "database_name": "Alpha"
  }'

Responses

OK

Bodyapplication/json
idinteger(TableId)required
Example:11
namestring(name)required
Example:"Bravo"
countinteger(count)required
Example:1000
counter_updated_at(string or null) or DateTimeISO8601 (string)(counter_updated_at)required
Any of:
string or null
created_atstring(created_at)\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\s(([+-]\...required

Datetime in custom format (2020-12-31 11:22:33 -0500 or 2020-12-31 11:22:33 UTC for UTC)

Example:"2020-12-31 11:22:33 UTC"
updated_atstring(updated_at)\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\s(([+-]\...required

Datetime in custom format (2020-12-31 11:22:33 -0500 or 2020-12-31 11:22:33 UTC for UTC)

Example:"2020-12-31 11:22:33 UTC"
estimated_storage_sizeinteger(estimated_storage_size)required
Example:1073741824
expire_daysinteger or null(expire_days)required
Example:30
last_log_timestampinteger or null(last_log_timestamp)required
Example:1356998400
delete_protectedboolean(delete_protected)required
Example:true
typestring(type)required
Value:"log"
Example:"log"
include_vboolean(include_v)requiredDeprecated

when true, Hive queries can access a virtual column "v" which contains a map of every data column's name to its value (represented as a string). Prefer to set a schema on the table instead of using "v".

Example:false
Response
{ "id": 11, "name": "Bravo", "count": 1000, "counter_updated_at": "string", "created_at": "2020-12-31 11:22:33 UTC", "updated_at": "2020-12-31 11:22:33 UTC", "estimated_storage_size": 1073741824, "expire_days": 30, "include_v": false, "last_log_timestamp": 1356998400, "delete_protected": true, "type": "log" }