forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Yang, Tong <yangtong2@huawei.com> Co-committed-by: Yang, Tong <yangtong2@huawei.com>
48 lines
4.1 KiB
HTML
48 lines
4.1 KiB
HTML
<a name="mrs_01_1443"></a><a name="mrs_01_1443"></a>
|
|
|
|
<h1 class="topictitle1">DELETE SEGMENT by DATE</h1>
|
|
<div id="body1595920213768"><div class="section" id="mrs_01_1443__s4ce0bc506f3c4e30bb308eaf985dcd3a"><h4 class="sectiontitle">Function</h4><p id="mrs_01_1443__a106901fcdc9c4b7582ae70159a230df8">This command is used to delete segments by loading date. Segments created before a specific date will be deleted.</p>
|
|
</div>
|
|
<div class="section" id="mrs_01_1443__s4e8c402d35484d91820439a19c72b613"><h4 class="sectiontitle">Syntax</h4><p id="mrs_01_1443__a96c8f19b10d940b497ad72ae64826c73"><b><span class="cmdname" id="mrs_01_1443__cmdname109099149292">DELETE FROM TABLE db_name.table_name WHERE SEGMENT.STARTTIME BEFORE date_value</span></b>;</p>
|
|
</div>
|
|
<div class="section" id="mrs_01_1443__sdc86ff9a798241b7a8df7d2ec6841410"><h4 class="sectiontitle">Parameter Description</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_1443__t318a052a52994a5dabf66dbe35dd805e" frame="border" border="1" rules="all"><caption><b>Table 1 </b>DELETE SEGMENT by DATE parameters</caption><thead align="left"><tr id="mrs_01_1443__rae00f493cd0c4441acb741e0f5989d7a"><th align="left" class="cellrowborder" valign="top" width="22.74%" id="mcps1.3.3.2.2.3.1.1"><p id="mrs_01_1443__a527119c14e08441a8253f221d7389cba"><strong id="mrs_01_1443__b1962915348562">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="77.25999999999999%" id="mcps1.3.3.2.2.3.1.2"><p id="mrs_01_1443__ac67824c8755c4cc28775ca46e9d02d23"><strong id="mrs_01_1443__b75341135155619">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="mrs_01_1443__r20b40195629e439ea88a0b7eba469974"><td class="cellrowborder" valign="top" width="22.74%" headers="mcps1.3.3.2.2.3.1.1 "><p id="mrs_01_1443__ade8d4a64371148e79f6d6c669682b12c">db_name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="77.25999999999999%" headers="mcps1.3.3.2.2.3.1.2 "><p id="mrs_01_1443__a52d04230918d47868f6aea77c78e523a">Database name. If this parameter is not specified, the current database is used.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_1443__r02e7f344bcb4461e82fb964489e27198"><td class="cellrowborder" valign="top" width="22.74%" headers="mcps1.3.3.2.2.3.1.1 "><p id="mrs_01_1443__a208e932e37e5419888410bdcd04a1247">table_name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="77.25999999999999%" headers="mcps1.3.3.2.2.3.1.2 "><p id="mrs_01_1443__ae993ad262f304d5b88c1b3b005121066">Name of a table in the specified database</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_1443__r2f4ef28f688148bea8ddb237e3a4208d"><td class="cellrowborder" valign="top" width="22.74%" headers="mcps1.3.3.2.2.3.1.1 "><p id="mrs_01_1443__a4046b3ac0d2a452e8b6b455faf0e43d9">date_value</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="77.25999999999999%" headers="mcps1.3.3.2.2.3.1.2 "><p id="mrs_01_1443__a2afb184c18da4372996b710dc75cb65c">Valid date when segments are started to be loaded. Segments before the date will be deleted.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="mrs_01_1443__sefbf7ad00d4641ea89a87ad507e7788d"><h4 class="sectiontitle">Precautions</h4><p id="mrs_01_1443__aa8cb2cb725b44749af037b3da89a4f0e">Segments cannot be deleted from the stream table.</p>
|
|
</div>
|
|
<div class="section" id="mrs_01_1443__sc2142baeff6d459b99474728f53795b6"><h4 class="sectiontitle">Example</h4><p id="mrs_01_1443__af134a9e6e04c4d9f8c58d2365eadd712"><b><span class="cmdname" id="mrs_01_1443__cmdname1698454514189">DELETE FROM TABLE db_name.table_name WHERE SEGMENT.STARTTIME BEFORE '2017-07-01 12:07:20'</span></b>;</p>
|
|
<p id="mrs_01_1443__a0353b6b34e324f72a2b4f9920d8b5401"><strong id="mrs_01_1443__b7856165916566">STARTTIME</strong> indicates the loading start time of different loads.</p>
|
|
</div>
|
|
<div class="section" id="mrs_01_1443__s5284317f91c74430a5a3ca82bdcc1d13"><h4 class="sectiontitle">System Response</h4><p id="mrs_01_1443__a4e0c8add1ab44a7ea082ad45e6192d0c">Success or failure will be recorded in CarbonData logs.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_1437.html">DML</a></div>
|
|
</div>
|
|
</div>
|
|
|