Skip to content

Create table

Request

Creates a table with default type 'log'. This endpoint offers the same functionality as the typed endpoint but without explicitly specifying the table type. 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
Query
idempotent_keystring(IdempotentKey)

A unique key to ensure idempotency of requests

source_tablestring

Name of an existing table to copy metadata from

including_propertiesboolean

When true, distribution and other properties will be copied from source_table

Bodyapplication/x-www-form-urlencoded
descriptionstring or null(description)

user-provided description of the table

Example:"Click events."
schemaArray of TableSchemaAsArray (items) or TableSchemaAsString (string)
One of:
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/create/Alpha/Bravo?idempotent_key=string&source_table=string&including_properties=true' \
  -H 'Authorization: TD1 <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d include_v=false \
  -d 'description=Click events.' \
  -d 'schema=[["name","string","first_name"],["creation_date","long"]]'

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