Apache Hive : WebHCat Reference PutTableLike

Last updated: December 12, 2024

Apache Hive : WebHCat Reference PutTableLike

Description

Create a new HCatalog table like an existing one.

URL

http://www.myserver.com/templeton/v1/ddl/database/:db/table/:existingtable/like/:newtable

Parameters

NameDescriptionRequired?Default
:dbThe database nameRequiredNone
:existingtableThe existing table nameRequiredNone
:newtableThe new table nameRequiredNone
groupThe user group to use when creating a tableOptionalNone
permissionsThe permissions string to use when creating a tableOptionalNone
externalAllows you to specify a location so that Hive does not use the default location for this table.Optionalfalse
ifNotExistsIf true, you will not receive an error if the table already exists.Optionalfalse
locationThe HDFS pathOptionalNone

The standard parameters are also supported.

Results

NameDescription
tableThe new table name
databaseThe database name

Example

Curl Command

% curl -s -X PUT -HContent-type:application/json -d {} \
 'http://localhost:50111/templeton/v1/ddl/database/default/table/test_table/like/test_table_2?user.name=ctdean'

JSON Output

{
 "table": "test_table_2",
 "database": "default"
}

Navigation Links Previous: DELETE ddl/database/:db/table/:table Next: GET ddl/database/:db/table/:table/partition