doc-exports/docs/dli/api-ref/dli_02_0034.html
Su, Xiaomeng 57a0d535be dli_api_0910_version_api
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
2023-10-16 22:01:57 +00:00

399 lines
32 KiB
HTML

<a name="dli_02_0034"></a><a name="dli_02_0034"></a>
<h1 class="topictitle1">Creating a Table</h1>
<div id="body8662426"><div class="section" id="dli_02_0034__sea3430ef1bf04eca94081b5ac8eaf9e0"><h4 class="sectiontitle">Function</h4><p id="dli_02_0034__en-us_topic_0069077904_p28022645">This API is used to create a table.</p>
<div class="note" id="dli_02_0034__note16145731153110"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="dli_02_0034__p51450311313">This API is a synchronous API.</p>
</div></div>
</div>
<div class="section" id="dli_02_0034__s8a8a0607d0f64fef8c4e1772fbd12d47"><h4 class="sectiontitle">URI</h4><ul id="dli_02_0034__en-us_topic_0069077904_ul55241806"><li id="dli_02_0034__en-us_topic_0069077904_li27414211">URI format<p id="dli_02_0034__en-us_topic_0069077904_p45401307"><a name="dli_02_0034__en-us_topic_0069077904_li27414211"></a><a name="en-us_topic_0069077904_li27414211"></a>POST /v1.0/{project_id}/databases/{database_name}/tables</p>
</li><li id="dli_02_0034__li7856197202411">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0034__en-us_topic_0069077904_table5958585" frame="border" border="1" rules="all"><caption><b>Table 1 </b>URI parameters</caption><thead align="left"><tr id="dli_02_0034__en-us_topic_0069077904_row4410301"><th align="left" class="cellrowborder" valign="top" width="19.5%" id="mcps1.3.2.2.2.1.2.5.1.1"><p id="dli_02_0034__aaf1abcbc3ede4c7b9be494924a4cae5d">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.28%" id="mcps1.3.2.2.2.1.2.5.1.2"><p id="dli_02_0034__a973b60dcc55b40f0b350c8c7c0a06a35">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12.97%" id="mcps1.3.2.2.2.1.2.5.1.3"><p id="dli_02_0034__p1142262273618">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="54.25%" id="mcps1.3.2.2.2.1.2.5.1.4"><p id="dli_02_0034__en-us_topic_0069077904_p165489262167">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_02_0034__row512855414118"><td class="cellrowborder" valign="top" width="19.5%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="dli_02_0034__en-us_topic_0069077803_p43412436">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="13.28%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="dli_02_0034__en-us_topic_0069077803_p26746391">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="12.97%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="dli_02_0034__p11422122217363">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.25%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="dli_02_0034__p1310472724012">Project ID, which is used for resource isolation. For details about how to obtain its value, see <a href="dli_02_0183.html">Obtaining a Project ID</a>.</p>
</td>
</tr>
<tr id="dli_02_0034__en-us_topic_0069077904_row41144912"><td class="cellrowborder" valign="top" width="19.5%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="dli_02_0034__en-us_topic_0069077904_p44403613">database_name</p>
</td>
<td class="cellrowborder" valign="top" width="13.28%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="dli_02_0034__en-us_topic_0069077904_p39922890">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="12.97%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="dli_02_0034__p184221722103616">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.25%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="dli_02_0034__p1742159183711">Name of the database where the new table resides.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="dli_02_0034__sb511d75c735745479703d43b4027ed48"><h4 class="sectiontitle">Request</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0034__en-us_topic_0069077904_table26855138" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="dli_02_0034__en-us_topic_0069077904_row58561923"><th align="left" class="cellrowborder" valign="top" width="20.98019801980198%" id="mcps1.3.3.2.2.5.1.1"><p id="dli_02_0034__a93a2e992dc85410cbbe874f8865ad782">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="10.722772277227723%" id="mcps1.3.3.2.2.5.1.2"><p id="dli_02_0034__en-us_topic_0069077904_p197866496166">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.623762376237625%" id="mcps1.3.3.2.2.5.1.3"><p id="dli_02_0034__en-us_topic_0069077904_p197867498161">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="54.67326732673268%" id="mcps1.3.3.2.2.5.1.4"><p id="dli_02_0034__en-us_topic_0069077904_p97864498169">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_02_0034__en-us_topic_0069077904_row32753783"><td class="cellrowborder" valign="top" width="20.98019801980198%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0034__en-us_topic_0069077904_p35810771">table_name</p>
</td>
<td class="cellrowborder" valign="top" width="10.722772277227723%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0034__en-us_topic_0069077904_p14991335">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="13.623762376237625%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0034__en-us_topic_0069077904_p6338652">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.67326732673268%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0034__en-us_topic_0069077904_p43668826">Name of the created table.</p>
<ul id="dli_02_0034__ul45217484103738"><li id="dli_02_0034__li4304178103738">The table name can contain only digits, letters, and underscores (_), but cannot contain only digits or start with an underscore (_).</li><li id="dli_02_0034__li38737602103738">The table name is case insensitive and cannot be left unspecified.</li><li id="dli_02_0034__li6457343172318">The table name can contain the dollar sign ($). Example: <strong id="dli_02_0034__b1044104914545">$test</strong></li><li id="dli_02_0034__li13094103103738">The length of the database name cannot exceed 128 characters.</li></ul>
</td>
</tr>
<tr id="dli_02_0034__en-us_topic_0069077904_row57475115"><td class="cellrowborder" valign="top" width="20.98019801980198%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0034__en-us_topic_0069077904_p24972744">data_location</p>
</td>
<td class="cellrowborder" valign="top" width="10.722772277227723%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0034__en-us_topic_0069077904_p9526402">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="13.623762376237625%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0034__en-us_topic_0069077904_p33441088">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.67326732673268%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0034__p554514315339">Location where data is stored. The options are as follows:</p>
<ul id="dli_02_0034__ul472665217340"><li id="dli_02_0034__li8726135263420">OBS: OBS table</li><li id="dli_02_0034__li16852135417349">DLI: DLI table</li><li id="dli_02_0034__li367412579349">VIEW: VIEW table</li></ul>
</td>
</tr>
<tr id="dli_02_0034__en-us_topic_0069077904_row18035908"><td class="cellrowborder" valign="top" width="20.98019801980198%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0034__en-us_topic_0069077904_p51622461">description</p>
</td>
<td class="cellrowborder" valign="top" width="10.722772277227723%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0034__en-us_topic_0069077904_p20669782">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.623762376237625%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0034__en-us_topic_0069077904_p63639607">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.67326732673268%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0034__en-us_topic_0069077904_p54534537">Information about the new table.</p>
</td>
</tr>
<tr id="dli_02_0034__en-us_topic_0069077904_row21048787"><td class="cellrowborder" valign="top" width="20.98019801980198%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0034__en-us_topic_0069077904_p27230225">columns</p>
</td>
<td class="cellrowborder" valign="top" width="10.722772277227723%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0034__en-us_topic_0069077904_p58164627">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="13.623762376237625%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0034__en-us_topic_0069077904_p13714370">Array of Objects</p>
</td>
<td class="cellrowborder" valign="top" width="54.67326732673268%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0034__en-us_topic_0069077904_p37122181">Columns of the new table. For details about column parameters, see <a href="#dli_02_0034__table985381581217">Table 4</a>. This parameter is optional when <strong id="dli_02_0034__b3864112916482">data_location</strong> is <strong id="dli_02_0034__b167951450184820">VIEW</strong>.</p>
</td>
</tr>
<tr id="dli_02_0034__row155310533195"><td class="cellrowborder" valign="top" width="20.98019801980198%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0034__p16553195311918">select_statement</p>
</td>
<td class="cellrowborder" valign="top" width="10.722772277227723%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0034__p1241794203010">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.623762376237625%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0034__p65531553141919">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.67326732673268%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0034__p13965123352016">Query statement required for creating a view. The database to which the table belongs needs to be specified in the query statement, in the format of <em id="dli_02_0034__i2021135134618">database</em>.<em id="dli_02_0034__i2019942519471">table</em>. This parameter is mandatory when <strong id="dli_02_0034__b183941626124812">data_location</strong> is <strong id="dli_02_0034__b1377744514817">VIEW</strong>.</p>
</td>
</tr>
<tr id="dli_02_0034__en-us_topic_0069077904_row50876212"><td class="cellrowborder" valign="top" width="20.98019801980198%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0034__en-us_topic_0069077904_p27332522">data_type</p>
</td>
<td class="cellrowborder" valign="top" width="10.722772277227723%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0034__en-us_topic_0069077904_p66450680">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.623762376237625%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0034__en-us_topic_0069077904_p13796039">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.67326732673268%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0034__p182832663914">Type of the data to be added to the OBS table. The options are as follows: Parquet, ORC, CSV, JSON, and Avro.</p>
<div class="note" id="dli_02_0034__note12582143553919"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="dli_02_0034__p15586183543916">This parameter is mandatory for an OBS table.</p>
</div></div>
</td>
</tr>
<tr id="dli_02_0034__en-us_topic_0069077904_row58092345"><td class="cellrowborder" valign="top" width="20.98019801980198%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0034__en-us_topic_0069077904_p7859520">data_path</p>
</td>
<td class="cellrowborder" valign="top" width="10.722772277227723%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0034__en-us_topic_0069077904_p32641412">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.623762376237625%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0034__en-us_topic_0069077904_p26708716">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.67326732673268%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0034__p15828102612393">Storage path of data in the new OBS table, which must be a path on OBS and must begin with <strong id="dli_02_0034__b842352706155612">obs</strong>.</p>
<div class="note" id="dli_02_0034__note9964829194018"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="dli_02_0034__p129644293407">This parameter is mandatory for an OBS table.</p>
<p id="dli_02_0034__p8524182102">Do not set this parameter to the OBS root directory. Otherwise, all data in the root directory will be cleared when you clear table data.</p>
</div></div>
</td>
</tr>
<tr id="dli_02_0034__en-us_topic_0069077904_row2007324"><td class="cellrowborder" valign="top" width="20.98019801980198%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0034__en-us_topic_0069077904_p28375523">with_column_header</p>
</td>
<td class="cellrowborder" valign="top" width="10.722772277227723%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0034__en-us_topic_0069077904_p16716047">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.623762376237625%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0034__en-us_topic_0069077904_p11822600">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="54.67326732673268%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0034__p1710044734010">Whether the table header is included in the OBS table data. Only data in CSV files has this attribute. This parameter is mandatory when <strong id="dli_02_0034__b5355115774818">data_location</strong> is <strong id="dli_02_0034__b1757715540487">OBS</strong>.</p>
</td>
</tr>
<tr id="dli_02_0034__en-us_topic_0069077904_row28741219"><td class="cellrowborder" valign="top" width="20.98019801980198%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0034__en-us_topic_0069077904_p46337402">delimiter</p>
</td>
<td class="cellrowborder" valign="top" width="10.722772277227723%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0034__en-us_topic_0069077904_p62342073">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.623762376237625%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0034__en-us_topic_0069077904_p16543177">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.67326732673268%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0034__p1610054764020">User-defined data delimiter. Only data in CSV files has this attribute. This parameter is mandatory when <strong id="dli_02_0034__b1687313119495">data_location</strong> is <strong id="dli_02_0034__b183929114913">OBS</strong>.</p>
</td>
</tr>
<tr id="dli_02_0034__en-us_topic_0069077904_row47489891"><td class="cellrowborder" valign="top" width="20.98019801980198%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0034__en-us_topic_0069077904_p21475923">quote_char</p>
</td>
<td class="cellrowborder" valign="top" width="10.722772277227723%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0034__en-us_topic_0069077904_p61828175">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.623762376237625%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0034__en-us_topic_0069077904_p42026304">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.67326732673268%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0034__p678605312408">User-defined reference character. Double quotation marks ("\") are used by default. Only data in CSV files has this attribute. This parameter is mandatory when <strong id="dli_02_0034__b19471111074915">data_location</strong> is <strong id="dli_02_0034__b19473161044919">OBS</strong>.</p>
</td>
</tr>
<tr id="dli_02_0034__en-us_topic_0069077904_row35534339"><td class="cellrowborder" valign="top" width="20.98019801980198%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0034__en-us_topic_0069077904_p59709223">escape_char</p>
</td>
<td class="cellrowborder" valign="top" width="10.722772277227723%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0034__en-us_topic_0069077904_p4608858">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.623762376237625%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0034__en-us_topic_0069077904_p37773255">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.67326732673268%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0034__p94755214015">User-defined escape character. Backslashes (\\) are used by default. Only data in CSV files has this attribute. This parameter is mandatory when <strong id="dli_02_0034__b88251159492">data_location</strong> is <strong id="dli_02_0034__b1827171534914">OBS</strong>.</p>
</td>
</tr>
<tr id="dli_02_0034__row10418733122115"><td class="cellrowborder" valign="top" width="20.98019801980198%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0034__p20419113311216">date_format</p>
</td>
<td class="cellrowborder" valign="top" width="10.722772277227723%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0034__p1441914339219">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.623762376237625%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0034__p1541963322112">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.67326732673268%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0034__p1841933312213">User-defined date type. <strong id="dli_02_0034__b842352706105245">yyyy-MM-dd</strong> is used by default. For details about the characters involved in the date format, see <a href="dli_02_0019.html#dli_02_0019__table489265920252">Table 3</a>. Only data in CSV and JSON files has this attribute. This parameter is mandatory when <strong id="dli_02_0034__b94782205495">data_location</strong> is <strong id="dli_02_0034__b848014200494">OBS</strong>.</p>
</td>
</tr>
<tr id="dli_02_0034__row747425517223"><td class="cellrowborder" valign="top" width="20.98019801980198%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0034__p13474255112219">timestamp_format</p>
</td>
<td class="cellrowborder" valign="top" width="10.722772277227723%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0034__p14749553229">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.623762376237625%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0034__p9474155582216">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.67326732673268%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0034__p1047565515220">User-defined timestamp type. <strong id="dli_02_0034__b842352706105311">yyyy-MM-dd HH:mm:ss</strong> is used by default. For definitions about characters in the timestamp format, see <a href="dli_02_0019.html#dli_02_0019__table489265920252">Table 3</a>. Only data in CSV and JSON files has this attribute. This parameter is mandatory when <strong id="dli_02_0034__b199655214490">data_location</strong> is <strong id="dli_02_0034__b19681721174918">OBS</strong>.</p>
</td>
</tr>
<tr id="dli_02_0034__row4385139192913"><td class="cellrowborder" valign="top" width="20.98019801980198%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0034__p135102615814">tags</p>
</td>
<td class="cellrowborder" valign="top" width="10.722772277227723%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0034__p251011605810">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.623762376237625%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0034__p451066135816">Array of Objects</p>
</td>
<td class="cellrowborder" valign="top" width="54.67326732673268%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0034__p55101469587">Database tag. For details about this object, see <a href="#dli_02_0034__table1769574233118">tags parameters</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="dli_02_0034__table1769574233118"></a><a name="table1769574233118"></a><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0034__table1769574233118" frame="border" border="1" rules="all"><caption><b>Table 3 </b>tags parameters</caption><thead align="left"><tr id="dli_02_0034__row1569524210317"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.3.2.5.1.1"><p id="dli_02_0034__p194012219139">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.3.2.5.1.2"><p id="dli_02_0034__p540724136">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.3.2.5.1.3"><p id="dli_02_0034__p840162161315">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.3.2.5.1.4"><p id="dli_02_0034__p16401271318">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_02_0034__row13696242103114"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.3.2.5.1.1 "><p id="dli_02_0034__p13401329138">key</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.3.2.5.1.2 "><p id="dli_02_0034__p940102141313">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.3.2.5.1.3 "><p id="dli_02_0034__p64019231317">String</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.3.2.5.1.4 "><p id="dli_02_0034__p5401021139">Tag key</p>
</td>
</tr>
<tr id="dli_02_0034__row14696542123115"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.3.2.5.1.1 "><p id="dli_02_0034__p164118215134">value</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.3.2.5.1.2 "><p id="dli_02_0034__p1141112181317">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.3.2.5.1.3 "><p id="dli_02_0034__p174114281318">String</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.3.2.5.1.4 "><p id="dli_02_0034__p16411125137">Tag value</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="dli_02_0034__table985381581217"></a><a name="table985381581217"></a><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0034__table985381581217" frame="border" border="1" rules="all"><caption><b>Table 4 </b><strong id="dli_02_0034__b1121313561916">columns</strong> parameters</caption><thead align="left"><tr id="dli_02_0034__row2853101561215"><th align="left" class="cellrowborder" valign="top" width="15.841584158415841%" id="mcps1.3.3.4.2.5.1.1"><p id="dli_02_0034__p14853015171210">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="6.9306930693069315%" id="mcps1.3.3.4.2.5.1.2"><p id="dli_02_0034__p1485310159129">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="7.920792079207921%" id="mcps1.3.3.4.2.5.1.3"><p id="dli_02_0034__p78531153121">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="69.3069306930693%" id="mcps1.3.3.4.2.5.1.4"><p id="dli_02_0034__p19853171513127">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_02_0034__row13853121518123"><td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.3.3.4.2.5.1.1 "><p id="dli_02_0034__p4853215181213">column_name</p>
</td>
<td class="cellrowborder" valign="top" width="6.9306930693069315%" headers="mcps1.3.3.4.2.5.1.2 "><p id="dli_02_0034__p185312158125">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="7.920792079207921%" headers="mcps1.3.3.4.2.5.1.3 "><p id="dli_02_0034__p185391571210">String</p>
</td>
<td class="cellrowborder" valign="top" width="69.3069306930693%" headers="mcps1.3.3.4.2.5.1.4 "><p id="dli_02_0034__p138541915171213">Name of a column.</p>
</td>
</tr>
<tr id="dli_02_0034__row178541515131211"><td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.3.3.4.2.5.1.1 "><p id="dli_02_0034__p3854111517123">type</p>
</td>
<td class="cellrowborder" valign="top" width="6.9306930693069315%" headers="mcps1.3.3.4.2.5.1.2 "><p id="dli_02_0034__p7854101513120">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="7.920792079207921%" headers="mcps1.3.3.4.2.5.1.3 "><p id="dli_02_0034__p6854141520121">String</p>
</td>
<td class="cellrowborder" valign="top" width="69.3069306930693%" headers="mcps1.3.3.4.2.5.1.4 "><p id="dli_02_0034__p1485419157124">Data type of a column. </p>
</td>
</tr>
<tr id="dli_02_0034__row085441513125"><td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.3.3.4.2.5.1.1 "><p id="dli_02_0034__p188542015141214">description</p>
</td>
<td class="cellrowborder" valign="top" width="6.9306930693069315%" headers="mcps1.3.3.4.2.5.1.2 "><p id="dli_02_0034__p208541715111215">No</p>
</td>
<td class="cellrowborder" valign="top" width="7.920792079207921%" headers="mcps1.3.3.4.2.5.1.3 "><p id="dli_02_0034__p2854191551215">String</p>
</td>
<td class="cellrowborder" valign="top" width="69.3069306930693%" headers="mcps1.3.3.4.2.5.1.4 "><p id="dli_02_0034__p1985471541214">Description of a column.</p>
</td>
</tr>
<tr id="dli_02_0034__row12854111511126"><td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.3.3.4.2.5.1.1 "><p id="dli_02_0034__p2085451514120">is_partition_column</p>
</td>
<td class="cellrowborder" valign="top" width="6.9306930693069315%" headers="mcps1.3.3.4.2.5.1.2 "><p id="dli_02_0034__p12854131513124">No</p>
</td>
<td class="cellrowborder" valign="top" width="7.920792079207921%" headers="mcps1.3.3.4.2.5.1.3 "><p id="dli_02_0034__p285441501216">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="69.3069306930693%" headers="mcps1.3.3.4.2.5.1.4 "><p id="dli_02_0034__p17854715191218">Whether the column is a partition column. The value <strong id="dli_02_0034__b6107824191113">true</strong> indicates a partition column, and the value <strong id="dli_02_0034__b1279192921112">false</strong> indicates a non-partition column. The default value is <strong id="dli_02_0034__b517733571115">false</strong>.</p>
<div class="note" id="dli_02_0034__note7775145281216"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="dli_02_0034__p1077585291212">When creating a partition table, ensure that at least one column in the table is a non-partition column. For details, see "Request example".</p>
</div></div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="dli_02_0034__s18d65f04c45c408aabc1b3d347692af0"><h4 class="sectiontitle">Response</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0034__en-us_topic_0069077904_table31581451" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Response parameters</caption><thead align="left"><tr id="dli_02_0034__en-us_topic_0069077904_row58930111"><th align="left" class="cellrowborder" valign="top" width="10.171017101710172%" id="mcps1.3.4.2.2.5.1.1"><p id="dli_02_0034__en-us_topic_0069077904_p166743810178">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="7.520752075207521%" id="mcps1.3.4.2.2.5.1.2"><p id="dli_02_0034__p546513231314">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="10.171017101710172%" id="mcps1.3.4.2.2.5.1.3"><p id="dli_02_0034__a58e59e9371174764aa6e22c379bf4e23">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="72.13721372137213%" id="mcps1.3.4.2.2.5.1.4"><p id="dli_02_0034__en-us_topic_0069077904_p867193813174">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_02_0034__en-us_topic_0069077904_row55469345"><td class="cellrowborder" valign="top" width="10.171017101710172%" headers="mcps1.3.4.2.2.5.1.1 "><p id="dli_02_0034__en-us_topic_0069077904_p63831923">is_success</p>
</td>
<td class="cellrowborder" valign="top" width="7.520752075207521%" headers="mcps1.3.4.2.2.5.1.2 "><p id="dli_02_0034__p1465162316310">No</p>
</td>
<td class="cellrowborder" valign="top" width="10.171017101710172%" headers="mcps1.3.4.2.2.5.1.3 "><p id="dli_02_0034__en-us_topic_0069077904_p41939966">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="72.13721372137213%" headers="mcps1.3.4.2.2.5.1.4 "><p id="dli_02_0034__p15380173521417">Whether the request is successfully executed. Value <span class="parmvalue" id="dli_02_0034__parmvalue10405423161014"><b>true</b></span> indicates that the request is successfully executed.</p>
</td>
</tr>
<tr id="dli_02_0034__en-us_topic_0069077904_row39702459"><td class="cellrowborder" valign="top" width="10.171017101710172%" headers="mcps1.3.4.2.2.5.1.1 "><p id="dli_02_0034__en-us_topic_0069077904_p61782645">message</p>
</td>
<td class="cellrowborder" valign="top" width="7.520752075207521%" headers="mcps1.3.4.2.2.5.1.2 "><p id="dli_02_0034__p114658231531">No</p>
</td>
<td class="cellrowborder" valign="top" width="10.171017101710172%" headers="mcps1.3.4.2.2.5.1.3 "><p id="dli_02_0034__en-us_topic_0069077904_p18400731">String</p>
</td>
<td class="cellrowborder" valign="top" width="72.13721372137213%" headers="mcps1.3.4.2.2.5.1.4 "><p id="dli_02_0034__p738093511419">System prompt. If execution succeeds, the parameter setting may be left blank.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="dli_02_0034__section121050712911"><h4 class="sectiontitle">Example Request</h4><ul id="dli_02_0034__ul134745018108"><li id="dli_02_0034__li44745001011">Create a table whose <strong id="dli_02_0034__b736763282218">data_location</strong> is <strong id="dli_02_0034__b7596174319221">OBS</strong> and data format of CSV.<pre class="screen" id="dli_02_0034__screen134785011019">{
"table_name": "tb1",
"data_location": "OBS",
"description": "",
"data_type": "csv",
"data_path": "obs://obs/path1",
"columns": [
{
"column_name": "column1",
"type": "string",
"description": "",
"is_partition_column": true
},
{
"column_name": "column2",
"type": "string",
"description": "",
"is_partition_column": false
}
],
"with_column_header": true,
"delimiter": ",",
"quote_char": "\"",
"escape_char": "\\",
"date_format": "yyyy-MM-dd",
"timestamp_format": "yyyy-MM-dd HH:mm:ss"
}</pre>
<div class="note" id="dli_02_0034__note448165011015"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="dli_02_0034__p348195018106">The values of <span class="parmname" id="dli_02_0034__parmname1369812894319"><b>date_format</b></span> and <span class="parmname" id="dli_02_0034__parmname1538581214314"><b>timestamp_format</b></span> must be the same as the time format in the imported CSV file.</p>
</div></div>
</li><li id="dli_02_0034__li17421822174311">Create a table whose <strong id="dli_02_0034__b39085482254">data_location</strong> is <strong id="dli_02_0034__b1990425022513">VIEW</strong>.<pre class="screen" id="dli_02_0034__screen8489503103">{
"table_name": "view1",
"data_location": "VIEW",
"columns": [
{
"column_name": "column1",
"type": "string",
"description": "",
"is_partition_column": true
},
{
"column_name": "column2",
"type": "string",
"description": "",
"is_partition_column": false
}
],
"select_statement": "select * from db1.tb1"
}</pre>
</li></ul>
</div>
<div class="section" id="dli_02_0034__section62727461152452"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="dli_02_0034__screen23699159152531">{
"is_success": true,
"message": ""
}</pre>
</div>
<div class="section" id="dli_02_0034__sf39cfd445ad24e9e82754fcb0027179d"><h4 class="sectiontitle">Status Codes</h4><p id="dli_02_0034__a04144ca3a08e4576b386c6a98f43a2ae"><a href="#dli_02_0034__tb12870f1c5f24b27abd55ca24264af36">Table 6</a> describes the status code.</p>
<div class="tablenoborder"><a name="dli_02_0034__tb12870f1c5f24b27abd55ca24264af36"></a><a name="tb12870f1c5f24b27abd55ca24264af36"></a><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0034__tb12870f1c5f24b27abd55ca24264af36" frame="border" border="1" rules="all"><caption><b>Table 6 </b>Status codes</caption><thead align="left"><tr id="dli_02_0034__r8d54231f95b14c01a5e55e95f3b2e838"><th align="left" class="cellrowborder" valign="top" width="30%" id="mcps1.3.7.3.2.3.1.1"><p id="dli_02_0034__ab49d21f312644072a331f43e92baf853">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="70%" id="mcps1.3.7.3.2.3.1.2"><p id="dli_02_0034__aea1d3bd107bb4c499da79a88832d256c">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_02_0034__r211ad4eb571d4d938e5579998723174e"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.7.3.2.3.1.1 "><p id="dli_02_0034__a3153e07b3a9749adba92599fe6628fbf">200</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.7.3.2.3.1.2 "><p id="dli_02_0034__p104431642124811">The job is created successfully.</p>
</td>
</tr>
<tr id="dli_02_0034__row44937531727"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.7.3.2.3.1.1 "><p id="dli_02_0034__p184941532219">400</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.7.3.2.3.1.2 "><p id="dli_02_0034__p2049413539219">Request error.</p>
</td>
</tr>
<tr id="dli_02_0034__row65331212142411"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.7.3.2.3.1.1 "><p id="dli_02_0034__p5537171216249">500</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.7.3.2.3.1.2 "><p id="dli_02_0034__p953813124249">Internal service error.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="dli_02_0034__section13596141025715"><h4 class="sectiontitle">Error Codes</h4><p id="dli_02_0034__p420584425712">If an error occurs when this API is invoked, the system does not return the result similar to the preceding example, but returns the error code and error information. For details, see <a href="dli_02_0056.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dli_02_0031.html">Table-related APIs</a></div>
</div>
</div>