forked from docs/doc-exports
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>
422 lines
35 KiB
HTML
422 lines
35 KiB
HTML
<a name="dli_02_0019"></a><a name="dli_02_0019"></a>
|
|
|
|
<h1 class="topictitle1">Importing Data</h1>
|
|
<div id="body8662426"><div class="section" id="dli_02_0019__scdd2c76953cf41dd8fb52312321ac2ea"><h4 class="sectiontitle">Function</h4><p id="dli_02_0019__p31050606102644">This API is used to import data from a file to a DLI or OBS table. Currently, only OBS data can be imported to a DLI or OBS table.</p>
|
|
<div class="note" id="dli_02_0019__note8972140113241"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="dli_02_0019__ul18621044113340"><li id="dli_02_0019__li17297050113340">This API is asynchronous.</li><li id="dli_02_0019__li1055104715317">When importing data, you can select an existing OBS bucket path or create an OBS bucket path, but only one OBS bucket path can be specified.</li><li id="dli_02_0019__li417954718542">If you need to create an OBS bucket, ensure that the bucket name complies with the following naming rules:<ul id="dli_02_0019__ul3406104915301"><li id="dli_02_0019__li44451247113012">The name must be globally unique in OBS.</li><li id="dli_02_0019__li134461747193017">The name must contain 3 to 63 characters. Only lowercase letters, digits, hyphens (-), and periods (.) are allowed.</li><li id="dli_02_0019__li84478471309">The name cannot start or end with a period (.) or hyphen (-), and cannot contain two consecutive periods (.) or contain a period (.) and a hyphen (-) adjacent to each other.</li><li id="dli_02_0019__li74471047133010">The name cannot be an IP address.</li><li id="dli_02_0019__li1244854719302">If the name contains any period (.), the security certificate verification may be triggered when you access the bucket or objects in the bucket.</li></ul>
|
|
</li><li id="dli_02_0019__li02716443716">If the type of a column in the source file to be imported does not match that of the target table, the query result of the row will be null.</li><li id="dli_02_0019__li15601945104843">Two or more concurrent tasks of importing data to the same table are not allowed.</li></ul>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="dli_02_0019__sc928ef43d6b341f3a994d05e2915c0cc"><h4 class="sectiontitle">URI</h4><ul id="dli_02_0019__ul13689182674410"><li id="dli_02_0019__li11689162604410">URI format<p id="dli_02_0019__en-us_topic_0069077807_p62863761"><a name="dli_02_0019__li11689162604410"></a><a name="li11689162604410"></a>POST /v1.0/{project_id}/jobs/import-table</p>
|
|
</li><li id="dli_02_0019__li1725612218454">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0019__en-us_topic_0069077803_table60779388" frame="border" border="1" rules="all"><caption><b>Table 1 </b>URI parameter</caption><thead align="left"><tr id="dli_02_0019__en-us_topic_0069077803_row61411666"><th align="left" class="cellrowborder" valign="top" width="14.23%" id="mcps1.3.2.2.2.1.2.5.1.1"><p id="dli_02_0019__a420a62a594f9410eaea229ffc8037a61">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="14.82%" id="mcps1.3.2.2.2.1.2.5.1.2"><p id="dli_02_0019__en-us_topic_0069077803_p873025824211">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.09%" id="mcps1.3.2.2.2.1.2.5.1.3"><p id="dli_02_0019__p42676271025">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="53.86%" id="mcps1.3.2.2.2.1.2.5.1.4"><p id="dli_02_0019__a692d3cd97b464aed90ba6d841900a4a5">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dli_02_0019__row12383142520408"><td class="cellrowborder" valign="top" width="14.23%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="dli_02_0019__p1947092614013">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.82%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="dli_02_0019__p147242612404">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.09%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="dli_02_0019__p1126719272213">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="53.86%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="dli_02_0019__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>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="dli_02_0019__s02726bccd97e44d49cff4e2c0c5761ab"><h4 class="sectiontitle">Request</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0019__en-us_topic_0069077807_table3426243" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="dli_02_0019__en-us_topic_0069077807_row55030134"><th align="left" class="cellrowborder" valign="top" width="19.247524752475247%" id="mcps1.3.3.2.2.5.1.1"><p id="dli_02_0019__a3747838af1bb434d953223268af62a2c">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="10.138613861386139%" id="mcps1.3.3.2.2.5.1.2"><p id="dli_02_0019__a0f4fb1cc1ce54d499c4c2c429def05d3">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="10.603960396039604%" id="mcps1.3.3.2.2.5.1.3"><p id="dli_02_0019__ad9369e514fbc48bc9c924468ff754fb4">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="60.009900990099005%" id="mcps1.3.3.2.2.5.1.4"><p id="dli_02_0019__afc02107ade4742e5973c669ad29bbdfb">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dli_02_0019__en-us_topic_0069077807_row52452228"><td class="cellrowborder" valign="top" width="19.247524752475247%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0019__en-us_topic_0069077807_p20772113">data_path</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.138613861386139%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0019__en-us_topic_0069077807_p4819582">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.603960396039604%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0019__en-us_topic_0069077807_p54841843">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.009900990099005%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0019__en-us_topic_0069077807_p13004313">Path to the data to be imported. Currently, only OBS data can be imported.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__en-us_topic_0069077807_row49929958"><td class="cellrowborder" valign="top" width="19.247524752475247%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0019__en-us_topic_0069077807_p17794775">data_type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.138613861386139%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0019__en-us_topic_0069077807_p32090702">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.603960396039604%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0019__en-us_topic_0069077807_p49210032">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.009900990099005%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0019__en-us_topic_0069077807_p26589671">Type of the data to be imported. Currently, data types of CSV, Parquet, ORC, JSON, and Avro are supported.</p>
|
|
<div class="note" id="dli_02_0019__note165812251376"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="dli_02_0019__p18581225133717">Data in <strong id="dli_02_0019__b1620667175516">Avro</strong> format generated by Hive tables cannot be imported.</p>
|
|
</div></div>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__en-us_topic_0069077807_row37980454"><td class="cellrowborder" valign="top" width="19.247524752475247%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0019__en-us_topic_0069077807_p56517943">database_name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.138613861386139%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0019__en-us_topic_0069077807_p14550672">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.603960396039604%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0019__en-us_topic_0069077807_p37753818">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.009900990099005%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0019__en-us_topic_0069077807_p38160445">Name of the database where the table to which data is imported resides.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__en-us_topic_0069077807_row7899687"><td class="cellrowborder" valign="top" width="19.247524752475247%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0019__en-us_topic_0069077807_p35894881">table_name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.138613861386139%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0019__en-us_topic_0069077807_p21804231">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.603960396039604%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0019__en-us_topic_0069077807_p21312323">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.009900990099005%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0019__en-us_topic_0069077807_p48576570">Name of the table to which data is imported.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__en-us_topic_0069077807_row34535952"><td class="cellrowborder" valign="top" width="19.247524752475247%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0019__en-us_topic_0069077807_p45948750">with_column_header</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.138613861386139%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0019__en-us_topic_0069077807_p30861244">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.603960396039604%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0019__en-us_topic_0069077807_p16732802">Boolean</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.009900990099005%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0019__en-us_topic_0069077807_p13179721">Whether the first line of the imported data contains column names, that is, headers. The default value is <span class="parmvalue" id="dli_02_0019__parmvalue1859660177142536"><b>false</b></span>, indicating that column names are not contained. This parameter can be specified when CSV data is imported.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__en-us_topic_0069077807_row51508628"><td class="cellrowborder" valign="top" width="19.247524752475247%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0019__en-us_topic_0069077807_p11449343">delimiter</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.138613861386139%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0019__en-us_topic_0069077807_p54981566">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.603960396039604%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0019__en-us_topic_0069077807_p24321850">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.009900990099005%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0019__en-us_topic_0069077807_p23912794">User-defined data delimiter. The default value is a comma (,). This parameter can be specified when CSV data is imported.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__en-us_topic_0069077807_row13888555"><td class="cellrowborder" valign="top" width="19.247524752475247%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0019__en-us_topic_0069077807_p51231165">quote_char</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.138613861386139%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0019__en-us_topic_0069077807_p56083687">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.603960396039604%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0019__en-us_topic_0069077807_p46484818">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.009900990099005%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0019__a135aff7e77d946a6b42325d2e20db2ec">User-defined quotation character. The default value is double quotation marks ("). This parameter can be specified when CSV data is imported.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__en-us_topic_0069077807_row64565334"><td class="cellrowborder" valign="top" width="19.247524752475247%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0019__en-us_topic_0069077807_p62409561">escape_char</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.138613861386139%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0019__en-us_topic_0069077807_p22009689">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.603960396039604%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0019__en-us_topic_0069077807_p37954365">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.009900990099005%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0019__en-us_topic_0069077807_p54404718">User-defined escape character. The default value is a backslash (\). This parameter can be specified when CSV data is imported.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__en-us_topic_0069077807_row19880414"><td class="cellrowborder" valign="top" width="19.247524752475247%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0019__en-us_topic_0069077807_p66809708">date_format</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.138613861386139%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0019__en-us_topic_0069077807_p42877307">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.603960396039604%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0019__p17755583137">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.009900990099005%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0019__en-us_topic_0069077807_p64768059">Specified date format. The default value is <strong id="dli_02_0019__b842352706105336">yyyy-MM-dd</strong>. For details about the characters involved in the date format, see <a href="#dli_02_0019__table489265920252">Table 3</a>. This parameter can be specified when data in the CSV or JSON format is imported.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row9590113253418"><td class="cellrowborder" valign="top" width="19.247524752475247%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0019__p115911532133416">bad_records_path</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.138613861386139%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0019__p259173218348">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.603960396039604%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0019__p14592153218343">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.009900990099005%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0019__p11592732173420"><strong id="dli_02_0019__b1771634283914">Bad records</strong> storage directory during job execution. After configuring this item, the <strong id="dli_02_0019__b1341319177309">bad records</strong> is not imported into the target table.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row153738534456"><td class="cellrowborder" valign="top" width="19.247524752475247%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0019__p15687657124516">timestamp_format</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.138613861386139%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0019__p868705774515">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.603960396039604%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0019__p931517831412">String</p>
|
|
<p id="dli_02_0019__p13701714101413"></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.009900990099005%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0019__p968725710450">Specified time format. The default value is <strong id="dli_02_0019__b842352706105357">yyyy-MM-dd HH:mm:ss</strong>. For definitions about characters in the time format, see <a href="#dli_02_0019__table489265920252">Table 3</a>. This parameter can be specified when data in the CSV or JSON format is imported.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row1199517251229"><td class="cellrowborder" valign="top" width="19.247524752475247%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0019__p8997725823">queue_name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.138613861386139%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0019__p1399719251626">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.603960396039604%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0019__p999752510211">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.009900990099005%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0019__p799712251428">Name of the queue that is specified to execute a task. If no queue is specified, the default queue is used.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row88756589913"><td class="cellrowborder" valign="top" width="19.247524752475247%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0019__p1787512581997">overwrite</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.138613861386139%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0019__p58756581890">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.603960396039604%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0019__p13875458199">Boolean</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.009900990099005%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0019__p08753581295">Whether to overwrite data. The default value is <span class="parmvalue" id="dli_02_0019__parmvalue523910199518"><b>false</b></span>, indicating appending write. If the value is <span class="parmvalue" id="dli_02_0019__parmvalue1363874123613"><b>true</b></span>, it indicates overwriting.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row1247215317104"><td class="cellrowborder" valign="top" width="19.247524752475247%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0019__p1547218381016">partition_spec</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.138613861386139%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0019__p14472133101011">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.603960396039604%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0019__p34729311018">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.009900990099005%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0019__p122249543388">Partition to which data is to be imported.</p>
|
|
<ul id="dli_02_0019__ul14843135813413"><li id="dli_02_0019__li1684365813418">If this parameter is not set, the entire table data is dynamically imported. The imported data must contain the data in the partition column.</li><li id="dli_02_0019__li1843135812411">If this parameter is set and all partition information is configured during data import, data is imported to the specified partition. The imported data cannot contain data in the partition column.</li><li id="dli_02_0019__li284375884120">If not all partition information is configured during data import, the imported data must contain all non-specified partition data. Otherwise, abnormal values such as <strong id="dli_02_0019__b196021729297">null</strong> exist in the partition field column of non-specified data after data import.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row980313143613"><td class="cellrowborder" valign="top" width="19.247524752475247%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_02_0019__p11803114261">conf</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.138613861386139%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_02_0019__p1980315142620">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.603960396039604%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_02_0019__p118031148616">Array of Strings</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.009900990099005%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_02_0019__p58031114964">User-defined parameter that applies to the job. Currently, <strong id="dli_02_0019__b1562312441380">dli.sql.dynamicPartitionOverwrite.enabled</strong> can be set to <strong id="dli_02_0019__b92921248883">false</strong> by default. If it is set to <strong id="dli_02_0019__b1122910561880">true</strong>, data in a specified partition is overwritten. If it is set to <strong id="dli_02_0019__b18812184315919">false</strong>, data in the entire DataSource table is dynamically overwritten.</p>
|
|
<div class="note" id="dli_02_0019__note736318501197"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="dli_02_0019__p17363250198">For dynamic overwrite of Hive partition tables, only the involved partition data can be overwritten. The entire table data cannot be overwritten.</p>
|
|
</div></div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="dli_02_0019__table489265920252"></a><a name="table489265920252"></a><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0019__table489265920252" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Definition of characters involved in the date and time patterns</caption><thead align="left"><tr id="dli_02_0019__row118943591258"><th align="left" class="cellrowborder" valign="top" width="12%" id="mcps1.3.3.3.2.4.1.1"><p id="dli_02_0019__p18894185913259"><strong id="dli_02_0019__b84235270620307">Character</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.3.3.2.4.1.2"><p id="dli_02_0019__p5894359122519"><strong id="dli_02_0019__b842352706203013">Date or Time Element</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="67%" id="mcps1.3.3.3.2.4.1.3"><p id="dli_02_0019__p1089445912519"><strong id="dli_02_0019__b9630204932810">Example</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dli_02_0019__row6894185912519"><td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.3.3.2.4.1.1 "><p id="dli_02_0019__p2089435919255">G</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.2.4.1.2 "><p id="dli_02_0019__p089405913251">Epoch ID</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67%" headers="mcps1.3.3.3.2.4.1.3 "><p id="dli_02_0019__p78941594258">AD</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row8894135911252"><td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.3.3.2.4.1.1 "><p id="dli_02_0019__p17894115915256">y</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.2.4.1.2 "><p id="dli_02_0019__p1089435942516">Year</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67%" headers="mcps1.3.3.3.2.4.1.3 "><p id="dli_02_0019__p17894759172511">1996; 96</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row7802105310312"><td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.3.3.2.4.1.1 "><p id="dli_02_0019__p1080217532315">M</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.2.4.1.2 "><p id="dli_02_0019__p19802125303118">Month</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67%" headers="mcps1.3.3.3.2.4.1.3 "><p id="dli_02_0019__p158021153133119">July; Jul; 07</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row1031413716327"><td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.3.3.2.4.1.1 "><p id="dli_02_0019__p133141037193213">w</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.2.4.1.2 "><p id="dli_02_0019__p6314337133214">Which week in a year</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67%" headers="mcps1.3.3.3.2.4.1.3 "><p id="dli_02_0019__p6314173712328">27 (Week 27 in the year)</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row926804183218"><td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.3.3.2.4.1.1 "><p id="dli_02_0019__p62686417327">W</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.2.4.1.2 "><p id="dli_02_0019__p427094112322">Which week in a month</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67%" headers="mcps1.3.3.3.2.4.1.3 "><p id="dli_02_0019__p9270941153213">2 (Second week in the month)</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row332544593218"><td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.3.3.2.4.1.1 "><p id="dli_02_0019__p12325184518327">D</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.2.4.1.2 "><p id="dli_02_0019__p1432513457325">Which day in a year</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67%" headers="mcps1.3.3.3.2.4.1.3 "><p id="dli_02_0019__p1632511452328">189 (Day 189 in the year)</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row17370115011358"><td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.3.3.2.4.1.1 "><p id="dli_02_0019__p14370350143517">d</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.2.4.1.2 "><p id="dli_02_0019__p63701150193513">Which day in a month</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67%" headers="mcps1.3.3.3.2.4.1.3 "><p id="dli_02_0019__p153721850193519">10 (Day 10 in the month)</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row636216557361"><td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.3.3.2.4.1.1 "><p id="dli_02_0019__p13621155183613">u</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.2.4.1.2 "><p id="dli_02_0019__p163621755183618">Which day in a week</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67%" headers="mcps1.3.3.3.2.4.1.3 "><p id="dli_02_0019__p1136218553361">1 (Monday), ..., 7 (Sunday)</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row165104724711"><td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.3.3.2.4.1.1 "><p id="dli_02_0019__p851184724718">a</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.2.4.1.2 "><p id="dli_02_0019__p10511047114719">am/pm flag</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67%" headers="mcps1.3.3.3.2.4.1.3 "><p id="dli_02_0019__p1751124714478">pm (Afternoon)</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row1525822744814"><td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.3.3.2.4.1.1 "><p id="dli_02_0019__p5258127204815">H</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.2.4.1.2 "><p id="dli_02_0019__p18258192794818">Hour time (0-23)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67%" headers="mcps1.3.3.3.2.4.1.3 "><p id="dli_02_0019__p1625882713487">2</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row727863518492"><td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.3.3.2.4.1.1 "><p id="dli_02_0019__p18278113518493">h</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.2.4.1.2 "><p id="dli_02_0019__p11278163511493">Hour time (1-12)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67%" headers="mcps1.3.3.3.2.4.1.3 "><p id="dli_02_0019__p5278135174910">12</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row648417065119"><td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.3.3.2.4.1.1 "><p id="dli_02_0019__p24846085112">m</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.2.4.1.2 "><p id="dli_02_0019__p04841801511">Minute time</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67%" headers="mcps1.3.3.3.2.4.1.3 "><p id="dli_02_0019__p154841209516">30</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row1299152119511"><td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.3.3.2.4.1.1 "><p id="dli_02_0019__p599110215511">s</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.2.4.1.2 "><p id="dli_02_0019__p599112195119">Second time</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67%" headers="mcps1.3.3.3.2.4.1.3 "><p id="dli_02_0019__p89301151125110">55</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row142275715311"><td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.3.3.2.4.1.1 "><p id="dli_02_0019__p822747155315">S</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.2.4.1.2 "><p id="dli_02_0019__p19227107115319">Which milliseconds</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67%" headers="mcps1.3.3.3.2.4.1.3 "><p id="dli_02_0019__p622777205313">978</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row11842184375419"><td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.3.3.2.4.1.1 "><p id="dli_02_0019__p20844243145413">z</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.2.4.1.2 "><p id="dli_02_0019__p384454315420">Time zone</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67%" headers="mcps1.3.3.3.2.4.1.3 "><p id="dli_02_0019__p1684464395413">Pacific Standard Time; PST; GMT-08:00</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="dli_02_0019__s5c44dce115f6409ba831575ee5d655b9"><h4 class="sectiontitle">Response</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0019__en-us_topic_0069077807_table64479813" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Response parameters</caption><thead align="left"><tr id="dli_02_0019__en-us_topic_0069077807_row472416"><th align="left" class="cellrowborder" valign="top" width="13.87%" id="mcps1.3.4.2.2.5.1.1"><p id="dli_02_0019__en-us_topic_0069077807_p144620506224">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="9.9%" id="mcps1.3.4.2.2.5.1.2"><p id="dli_02_0019__p19131126172118">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="10.36%" id="mcps1.3.4.2.2.5.1.3"><p id="dli_02_0019__a1d986c4bb4764185ae9d4173b0dec960">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="65.86999999999999%" id="mcps1.3.4.2.2.5.1.4"><p id="dli_02_0019__en-us_topic_0069077807_p84635013227">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dli_02_0019__en-us_topic_0069077807_row4605057"><td class="cellrowborder" valign="top" width="13.87%" headers="mcps1.3.4.2.2.5.1.1 "><p id="dli_02_0019__en-us_topic_0069077807_p37465303">is_success</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9.9%" headers="mcps1.3.4.2.2.5.1.2 "><p id="dli_02_0019__p161311526202116">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.36%" headers="mcps1.3.4.2.2.5.1.3 "><p id="dli_02_0019__en-us_topic_0069077807_p57196205">Boolean</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="65.86999999999999%" headers="mcps1.3.4.2.2.5.1.4 "><p id="dli_02_0019__en-us_topic_0069077807_p2381053">Indicates whether the request is successfully sent. Value <span class="parmvalue" id="dli_02_0019__parmvalue3175800916327"><b>true</b></span> indicates that the request is successfully sent.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__en-us_topic_0069077807_row21429483"><td class="cellrowborder" valign="top" width="13.87%" headers="mcps1.3.4.2.2.5.1.1 "><p id="dli_02_0019__en-us_topic_0069077807_p58066551">message</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9.9%" headers="mcps1.3.4.2.2.5.1.2 "><p id="dli_02_0019__p1913132611217">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.36%" headers="mcps1.3.4.2.2.5.1.3 "><p id="dli_02_0019__en-us_topic_0069077807_p64729059">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="65.86999999999999%" headers="mcps1.3.4.2.2.5.1.4 "><p id="dli_02_0019__a4fa277540d3e42e48cec2027a36ca6bc">System prompt. If execution succeeds, the parameter setting may be left blank.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__en-us_topic_0069077807_row9953212"><td class="cellrowborder" valign="top" width="13.87%" headers="mcps1.3.4.2.2.5.1.1 "><p id="dli_02_0019__en-us_topic_0069077807_p903863">job_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9.9%" headers="mcps1.3.4.2.2.5.1.2 "><p id="dli_02_0019__p1513152652111">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.36%" headers="mcps1.3.4.2.2.5.1.3 "><p id="dli_02_0019__en-us_topic_0069077807_p24669326">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="65.86999999999999%" headers="mcps1.3.4.2.2.5.1.4 "><p id="dli_02_0019__en-us_topic_0069077807_p52058427">ID of a job returned after a job is generated and submitted by using SQL statements. The job ID can be used to query the job status and results.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row11925128105910"><td class="cellrowborder" valign="top" width="13.87%" headers="mcps1.3.4.2.2.5.1.1 "><p id="dli_02_0019__p1392518885913">job_mode</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9.9%" headers="mcps1.3.4.2.2.5.1.2 "><p id="dli_02_0019__p39261845911">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.36%" headers="mcps1.3.4.2.2.5.1.3 "><p id="dli_02_0019__p892648195914">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="65.86999999999999%" headers="mcps1.3.4.2.2.5.1.4 "><p id="dli_02_0019__p4229105292420">Job execution mode. The options are as follows:</p>
|
|
<ul id="dli_02_0019__ul194411241202517"><li id="dli_02_0019__li16442124112518"><strong id="dli_02_0019__b0599767522">async</strong>: asynchronous</li><li id="dli_02_0019__li2441252182510"><strong id="dli_02_0019__b1964213712524">sync</strong>: synchronous</li></ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="dli_02_0019__section1389955019136"><h4 class="sectiontitle">Example Request</h4><pre class="screen" id="dli_02_0019__screen60806546173822">{
|
|
"data_path": "obs://home/data1/DLI/t1.csv",
|
|
"data_type": "csv",
|
|
"database_name": "db2",
|
|
"table_name": "t2",
|
|
"with_column_header": false,
|
|
"delimiter": ",",
|
|
"quote_char": ",",
|
|
"escape_char": ",",
|
|
"date_format": "yyyy-MM-dd",
|
|
"timestamp_format": "yyyy-MM-dd'T'HH:mm:ss.SSSZZ",
|
|
"queue_name": "queue2",
|
|
"overwrite": false,
|
|
"partition_spec":{
|
|
"column1": "2020-01-01",
|
|
"column2": "columnPartValue"
|
|
}
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="dli_02_0019__section16491889173758"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="dli_02_0019__screen9704305173839">{
|
|
"is_success": true,
|
|
"message": "import data to table t2 started",
|
|
"job_id": "6b29eb77-4c16-4e74-838a-2cf7959e9202",
|
|
"job_mode":"async"
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="dli_02_0019__sf39cfd445ad24e9e82754fcb0027179d"><h4 class="sectiontitle">Status Codes</h4><p id="dli_02_0019__a04144ca3a08e4576b386c6a98f43a2ae"><a href="#dli_02_0019__tb12870f1c5f24b27abd55ca24264af36">Table 5</a> describes the status code.</p>
|
|
|
|
<div class="tablenoborder"><a name="dli_02_0019__tb12870f1c5f24b27abd55ca24264af36"></a><a name="tb12870f1c5f24b27abd55ca24264af36"></a><table cellpadding="4" cellspacing="0" summary="" id="dli_02_0019__tb12870f1c5f24b27abd55ca24264af36" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Status codes</caption><thead align="left"><tr id="dli_02_0019__r8d54231f95b14c01a5e55e95f3b2e838"><th align="left" class="cellrowborder" valign="top" width="30%" id="mcps1.3.7.3.2.3.1.1"><p id="dli_02_0019__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_0019__aea1d3bd107bb4c499da79a88832d256c">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dli_02_0019__r211ad4eb571d4d938e5579998723174e"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.7.3.2.3.1.1 "><p id="dli_02_0019__a3153e07b3a9749adba92599fe6628fbf">200</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.7.3.2.3.1.2 "><p id="dli_02_0019__p104431642124811">Import succeeded. </p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row44937531727"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.7.3.2.3.1.1 "><p id="dli_02_0019__p184941532219">400</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.7.3.2.3.1.2 "><p id="dli_02_0019__p2049413539219">Request error.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_02_0019__row65331212142411"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.7.3.2.3.1.1 "><p id="dli_02_0019__p5537171216249">500</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.7.3.2.3.1.2 "><p id="dli_02_0019__p953813124249">Internal service error.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="dli_02_0019__section13596141025715"><h4 class="sectiontitle">Error Codes</h4><p id="dli_02_0019__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 Code</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dli_02_0017.html">Job-related APIs</a></div>
|
|
</div>
|
|
</div>
|
|
|