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>
26 lines
4.8 KiB
HTML
26 lines
4.8 KiB
HTML
<a name="mrs_01_1411"></a><a name="mrs_01_1411"></a>
|
|
|
|
<h1 class="topictitle1">Modify the CarbonData Table</h1>
|
|
<div id="body1595920209609"><div class="section" id="mrs_01_1411__section02731659135010"><h4 class="sectiontitle"><strong id="mrs_01_1411__b2508458134011">SET</strong> and <strong id="mrs_01_1411__b353175513408">UNSET</strong></h4><p id="mrs_01_1411__p128146267518">When the <strong id="mrs_01_1411__b1186465185011">SET</strong> command is executed, the new properties overwrite the existing ones.</p>
|
|
<ul id="mrs_01_1411__ul168111465515"><li id="mrs_01_1411__li205904142209">SORT SCOPE<p id="mrs_01_1411__p53212257224"><a name="mrs_01_1411__li205904142209"></a><a name="li205904142209"></a>The following is an example of the <strong id="mrs_01_1411__b5395125920173">SET SORT SCOPE</strong> command:</p>
|
|
<p id="mrs_01_1411__p19201348182212"><b><span class="cmdname" id="mrs_01_1411__cmdname1420174822218">ALTER TABLE</span></b> <i><span class="varname" id="mrs_01_1411__varname2020124842217">tablename</span></i> <b><span class="cmdname" id="mrs_01_1411__cmdname8201154813221">SET TBLPROPERTIES('SORT_SCOPE'</span></b>=<i><span class="varname" id="mrs_01_1411__varname42011848152219">'no_sort'</span></i>)</p>
|
|
<p id="mrs_01_1411__p10790015112316">After running the <strong id="mrs_01_1411__b933012173187">UNSET SORT SCOPE</strong> command, the default value <strong id="mrs_01_1411__b20501454187">NO_SORT</strong> is adopted.</p>
|
|
<p id="mrs_01_1411__p014164611232">The following is an example of the <strong id="mrs_01_1411__b14601162194">UNSET SORT SCOPE</strong> command:</p>
|
|
<p id="mrs_01_1411__p92691356162316"><b><span class="cmdname" id="mrs_01_1411__cmdname1267319119243">ALTER TABLE</span></b> <i><span class="varname" id="mrs_01_1411__varname146739152419">tablename</span></i> <b><span class="cmdname" id="mrs_01_1411__cmdname86731415241">UNSET TBLPROPERTIES('SORT_SCOPE'</span></b>)</p>
|
|
</li><li id="mrs_01_1411__li8813415559">SORT COLUMNS<p id="mrs_01_1411__p7682103525616"><a name="mrs_01_1411__li8813415559"></a><a name="li8813415559"></a>The following is an example of the <strong id="mrs_01_1411__b17012518595">SET SORT COLUMNS</strong> command:</p>
|
|
<p id="mrs_01_1411__p587954817567"><b><span class="cmdname" id="mrs_01_1411__cmdname7444190145813">ALTER TABLE</span></b> <i><span class="varname" id="mrs_01_1411__varname9895620135815">tablename</span></i> <b><span class="cmdname" id="mrs_01_1411__cmdname1485610195816">SET TBLPROPERTIES('SORT_COLUMNS'</span></b>=<i><span class="varname" id="mrs_01_1411__varname942015599584">'column1'</span></i>)</p>
|
|
<p id="mrs_01_1411__p121599610591">After this command is executed, the new value of <strong id="mrs_01_1411__b13951361215">SORT_COLUMNS</strong> is used. Users can adjust the <strong id="mrs_01_1411__b1030213597110">SORT_COLUMNS</strong> based on the query results, but the original data is not affected. The operation does not affect the query performance of the original data segments which are not sorted by new <strong id="mrs_01_1411__b195051815151">SORT_COLUMNS</strong>.</p>
|
|
<p id="mrs_01_1411__p833513517812">The <strong id="mrs_01_1411__b1943664460">UNSET</strong> command is not supported, but the <strong id="mrs_01_1411__b21441311688">SORT_COLUMNS</strong> can be set to empty string instead of using the <strong id="mrs_01_1411__b36518125167">UNSET</strong> command.</p>
|
|
<p id="mrs_01_1411__p1687931181411"><b><span class="cmdname" id="mrs_01_1411__cmdname19687123131415">ALTER TABLE</span></b> <i><span class="varname" id="mrs_01_1411__varname19687183118140">tablename</span></i> <b><span class="cmdname" id="mrs_01_1411__cmdname5687153113149">SET TBLPROPERTIES('SORT_COLUMNS'</span></b>=<i><span class="varname" id="mrs_01_1411__varname12687113131419">''</span></i>)</p>
|
|
<div class="note" id="mrs_01_1411__nc2fda174e5de40a4b9d7a54119b85a64"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="mrs_01_1411__u54b97786ea5c41f59081d0ff24eadeb5"><li class="text" id="mrs_01_1411__l918916e9a41b44239baa414034e86903">The later version will enhance custom compaction to resort the old segments.</li><li id="mrs_01_1411__l04617e73ea82433fa4eb06adbfb546ee">The value of <strong id="mrs_01_1411__b14806537146">SORT_COLUMNS</strong> cannot be modified in the streaming table.</li><li id="mrs_01_1411__li195661993512">If the <strong id="mrs_01_1411__b391631201811">inverted index</strong> column is removed from <strong id="mrs_01_1411__b0107192215184">SORT_COLUMNS</strong>, <strong id="mrs_01_1411__b1527835161815">inverted index</strong> will not be created in this column. However, the old configuration of <strong id="mrs_01_1411__b42451037171920">INVERTED_INDEX</strong> will be kept.</li></ul>
|
|
</div></div>
|
|
</li></ul>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_1407.html">CarbonData Table Management</a></div>
|
|
</div>
|
|
</div>
|
|
|