Create a table (clone and undrop are separate subresources)
POST {{baseUrl}}/api/v2/databases/:database/schemas/:schema/tables?createMode=errorIfExists©Grants=false
Create a table.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
createMode | string | Query parameter allowing support for different modes of resource creation. Possible values include: |
errorIfExists
: Throws an error if you try to create a resource that already exists.orReplace
: Automatically replaces the existing resource with the current one.ifNotExists
: Creates a new resource when an alter is requested for a non-existent resource. | |copyGrants
| boolean | | Query parameter to enable copy grants when creating the object. |
Request Body
{"name"=>"<string>", "kind"=>"PERMANENT", "cluster_by"=>["<string>", "<string>"], "enable_schema_evolution"=>"<boolean>", "change_tracking"=>"<boolean>", "data_retention_time_in_days"=>"<integer>", "max_data_extension_time_in_days"=>"<integer>", "default_ddl_collation"=>"<string>", "columns"=>[{"name"=>"<string>", "datatype"=>"<string>", "nullable"=>true, "collate"=>"<string>", "default"=>"<string>", "autoincrement"=>"<boolean>", "autoincrement_start"=>"<integer>", "autoincrement_increment"=>"<integer>", "constraints"=>[{"name"=>"<string>", "column_names"=>["<string>", "<string>"], "constraint_type"=>"<string>"}, {"name"=>"<string>", "column_names"=>["<string>", "<string>"], "constraint_type"=>"<string>"}], "comment"=>"<string>"}, {"name"=>"<string>", "datatype"=>"<string>", "nullable"=>true, "collate"=>"<string>", "default"=>"<string>", "autoincrement"=>"<boolean>", "autoincrement_start"=>"<integer>", "autoincrement_increment"=>"<integer>", "constraints"=>[{"name"=>"<string>", "column_names"=>["<string>", "<string>"], "constraint_type"=>"<string>"}, {"name"=>"<string>", "column_names"=>["<string>", "<string>"], "constraint_type"=>"<string>"}], "comment"=>"<string>"}], "constraints"=>[{"name"=>"<string>", "column_names"=>["<string>", "<string>"], "constraint_type"=>"<string>"}, {"name"=>"<string>", "column_names"=>["<string>", "<string>"], "constraint_type"=>"<string>"}], "comment"=>"<string>", "created_on"=>"<dateTime>", "database_name"=>"<string>", "schema_name"=>"<string>", "rows"=>"<long>", "bytes"=>"<long>", "owner"=>"<string>", "dropped_on"=>"<dateTime>", "automatic_clustering"=>"<boolean>", "search_optimization"=>"<boolean>", "search_optimization_progress"=>"<long>", "search_optimization_bytes"=>"<long>", "owner_role_type"=>"<string>", "budget"=>"<string>"}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Accept | string |
RESPONSES
status: OK
{"status":"\u003cstring\u003e"}