Skip to content

Update table schema

Request

Updates the specified table schema. Schema can include column descriptions in the format [name, type, alias, description].

Security
ApiKeyAuth
Path
database_namestring(name)required

database name

Example:Alpha
table_namestring(name)required
Example:Bravo
Bodyapplication/x-www-form-urlencoded
namestring
Example:"table1_new_name"
schemaArray of TableSchemaAsArray (items) or TableSchemaAsString (string)required
One of:
ignore_duplicate_schemaboolean
Example:true
detect_schemaboolean
Example:true
include_vboolean
Example:true
expire_daysinteger
Example:1
overwriteboolean
Example:true
curl -i -X POST \
  https://api.treasuredata.com/v3/table/update-schema/Alpha/Bravo \
  -H 'Authorization: TD1 <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d name=table1_new_name \
  -d 'schema=[["name","string","first_name"],["creation_date","long"]]' \
  -d ignore_duplicate_schema=true \
  -d detect_schema=true \
  -d include_v=true \
  -d expire_days=1 \
  -d overwrite=true

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" }