Yang, Tong 48706b7552 MRS COMP-LTS 320-lts.1 version
Reviewed-by: Kacur, Michal <michal.kacur@t-systems.com>
Co-authored-by: Yang, Tong <yangtong2@huawei.com>
Co-committed-by: Yang, Tong <yangtong2@huawei.com>
2024-04-12 12:51:10 +00:00

50 lines
4.7 KiB
HTML

<a name="mrs_01_24740"></a><a name="mrs_01_24740"></a>
<h1 class="topictitle1">CHANGE_TABLE</h1>
<div id="body0000001585194857"><div class="section" id="mrs_01_24740__en-us_topic_0265792787_s1c2fb9c848d3442b9a23498a756f65f5"><h4 class="sectiontitle">Function</h4><p id="mrs_01_24740__en-us_topic_0265792787_a6af5f5e3223c47749f548ae92a5122c9">The <strong id="mrs_01_24740__b3466162319501">CHANGE_TABLE</strong> command can be used to modify the type and index of a table. Key parameters such as the type and index of Hudi tables cannot be modified. Therefore, this command is actually used to rewrite Hudi tables.</p>
</div>
<div class="section" id="mrs_01_24740__en-us_topic_0265792787_s74e38960eb19422bb6e00e049a8e144e"><h4 class="sectiontitle">Syntax</h4><pre class="screen" id="mrs_01_24740__screen087215309215">call change_table(table =&gt; '[table_name]', hoodie.index.type =&gt; '[index_type]', hoodie.datasource.write.table.type =&gt; '[table_type]');</pre>
</div>
<div class="section" id="mrs_01_24740__en-us_topic_0265792787_sc562f5f2c9e440dc8ea25a1f3b145668"><h4 class="sectiontitle">Parameter Description</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_24740__en-us_topic_0265792787_tfbb991adf4344d2fb27629f70630100e" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters</caption><thead align="left"><tr id="mrs_01_24740__en-us_topic_0265792787_ra556d91581f04f5188576c64927a0949"><th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.3.1.1"><p id="mrs_01_24740__en-us_topic_0265792787_af4cec97db0194bc4b70e1eeee4a8dd0e"><strong id="mrs_01_24740__en-us_topic_0265792787_a7159780c1ca74891b3b3f3781df6b927">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.3.2.2.3.1.2"><p id="mrs_01_24740__en-us_topic_0265792787_a6014dc4378b24178aac7350b85362666"><strong id="mrs_01_24740__en-us_topic_0265792787_a61e428b8462f4ec6837d268ee9c7e33d">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="mrs_01_24740__en-us_topic_0265792787_r32b79a740ce44d94a3a3982e80ba7f48"><td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.3.1.1 "><p id="mrs_01_24740__p1887422881">table_name</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.3.2.2.3.1.2 "><p id="mrs_01_24740__en-us_topic_0265792787_ad05a3f749c7c45b780e0d8b4218b508d">Name of the table to be modified</p>
</td>
</tr>
<tr id="mrs_01_24740__row384112558810"><td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.3.1.1 "><p id="mrs_01_24740__p08410551984">table_type</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.3.2.2.3.1.2 "><p id="mrs_01_24740__p984116551581">Type of the table to be modified</p>
</td>
</tr>
<tr id="mrs_01_24740__row14154629792"><td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.3.1.1 "><p id="mrs_01_24740__p1315510293914">index_type</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.3.2.2.3.1.2 "><p id="mrs_01_24740__p101557291299">Type of the index to be modified</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="mrs_01_24740__en-us_topic_0265792787_sbdb980f99f28440d9181a194ac5f3bea"><h4 class="sectiontitle">Precautions</h4><p id="mrs_01_24740__p184671102178">If the index type to be modified has other configuration parameters, the parameters must be transferred to the SQL statement in the <strong id="mrs_01_24740__b482113507575">key =&gt;'value'</strong> format.</p>
<p id="mrs_01_24740__en-us_topic_0265792787_af731053dad054dbfa9909ed3193d40e3">For example, to change the index type to bucket, run the following command:</p>
<pre class="screen" id="mrs_01_24740__screen911101920117">call change_table(table =&gt; 'hudi_table1', hoodie.index.type =&gt; 'BUCKET', hoodie.bucket.index.num.buckets =&gt; '3');</pre>
</div>
<div class="section" id="mrs_01_24740__en-us_topic_0265792787_s48d23baacfa245edaf9586eb4ed766d6"><h4 class="sectiontitle">Example</h4><p id="mrs_01_24740__p2085424381114">call change_table(table =&gt; 'hudi_table1', hoodie.index.type =&gt; 'SIMPLE', hoodie.datasource.write.table.type =&gt; 'MERGE_ON_READ');</p>
</div>
<div class="section" id="mrs_01_24740__en-us_topic_0265792787_s3bdfd790912444eaa61e25c34d4fbe0b"><h4 class="sectiontitle">System Response</h4><p id="mrs_01_24740__en-us_topic_0265792787_a023bbb240c584e7ba4b2b2c7981f64b9">After the execution is complete, you can run the <strong id="mrs_01_24740__b162723915120">desc formatted table</strong> command to view the table properties.</p>
</div>
<p id="mrs_01_24740__p8060118"></p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_24739.html">CALL COMMAND</a></div>
</div>
</div>