Skip to content

Update table

Request

Updates a table.

Security
ApiKeyAuth
Path
database_namestring(name)required

database name

Example:Alpha
table_namestring(name)required
Example:Bravo
Bodyapplication/x-www-form-urlencoded
detect_schemaboolean
Example:true
expire_daysinteger or null(expire_days)
Example:30
namestring(name)
Example:"Bravo"
descriptionstring or null(description)

user-provided description of the table

Example:"Click events."
schemaArray of TableSchemaAsArray (items) or TableSchemaAsString (string)
One of:
ignore_duplicate_schemaboolean
Example:true
overwriteboolean

whether to override a possible existing table in case of updating the name

Example:false
include_vboolean(include_v)Deprecated

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
curl -i -X POST \
  https://api.treasuredata.com/v3/table/update/Alpha/Bravo \
  -H 'Authorization: TD1 <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d detect_schema=true \
  -d expire_days=30 \
  -d include_v=false \
  -d name=Bravo \
  -d 'description=Click events.' \
  -d 'schema=[["name","string","first_name"],["creation_date","long"]]' \
  -d ignore_duplicate_schema=true \
  -d overwrite=false

Responses

OK

Bodyapplication/json
databasestring(name)required

database name

Example:"Alpha"
tablestring(name)required
Example:"Bravo"
typestring(type)required
Value:"log"
Example:"log"
Response
{ "database": "Alpha", "table": "Bravo", "type": "log" }