Yang, Tong 3f5759eed2 MRS comp-lts 2.0.38.SP20 version
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>
2023-01-19 17:08:45 +00:00

56 lines
7.9 KiB
HTML

<a name="mrs_01_1141"></a><a name="mrs_01_1141"></a>
<h1 class="topictitle1">String Reverse</h1>
<div id="body8662426"><div class="section" id="mrs_01_1141__en-us_topic_0000001173789928_s6b0c71caf7ba42f8a0c3c6b5d6783943"><h4 class="sectiontitle">Overview</h4><p id="mrs_01_1141__en-us_topic_0000001173789928_a2b555a73d26a4e39be94ba416ab44c1d">The <span class="parmname" id="mrs_01_1141__en-us_topic_0000001173789928_p7fe8cccc026744209917a3efb74b4337"><b>String Reverse</b></span> operator reverses existing fields to generate new fields.</p>
</div>
<div class="section" id="mrs_01_1141__en-us_topic_0000001173789928_sdddc699525cf4034a5ac7d5ac11b7001"><h4 class="sectiontitle">Input and Output</h4><ul id="mrs_01_1141__en-us_topic_0000001173789928_ud3c8397ae8b240d6b5aaf812cbb3f08b"><li id="mrs_01_1141__en-us_topic_0000001173789928_lba34398d3c334b3abda48f86c9818184">Input: fields to be reversed</li><li id="mrs_01_1141__en-us_topic_0000001173789928_l65f796d60da04fbab4dfec05ffea5ec0">Output: new fields</li></ul>
</div>
<div class="section" id="mrs_01_1141__en-us_topic_0000001173789928_s962b403c96eb4a4f81360a71f18ae698"><h4 class="sectiontitle">Parameter Description</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_1141__en-us_topic_0000001173789928_tdecf309e26f245dda13db6de4f9aade2" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Operator parameter description</caption><thead align="left"><tr id="mrs_01_1141__en-us_topic_0000001173789928_r146c5f9b7b754a059c7d3393791f134a"><th align="left" class="cellrowborder" valign="top" width="18.37%" id="mcps1.3.3.2.2.6.1.1"><p id="mrs_01_1141__en-us_topic_0000001173789928_a7ed601f8f14b467d9b18c6390cc1e6f5">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="54.730000000000004%" id="mcps1.3.3.2.2.6.1.2"><p id="mrs_01_1141__en-us_topic_0000001173789928_a5db83854f32f408b905c4fd3107b9131">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.3.3.2.2.6.1.3"><p id="mrs_01_1141__en-us_topic_0000001173789928_a528825accfe14153b5504f80f2935aee">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="9.69%" id="mcps1.3.3.2.2.6.1.4"><p id="mrs_01_1141__en-us_topic_0000001173789928_a11809ec118c24327aa0bc23d2119f4fe">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="9.69%" id="mcps1.3.3.2.2.6.1.5"><p id="mrs_01_1141__en-us_topic_0000001173789928_ad914a594a1624d0eb41cbdbe2eda9f2d">Default Value</p>
</th>
</tr>
</thead>
<tbody><tr id="mrs_01_1141__en-us_topic_0000001173789928_r8eef76834f674dca9081f38c3f4f1630"><td class="cellrowborder" valign="top" width="18.37%" headers="mcps1.3.3.2.2.6.1.1 "><p id="mrs_01_1141__en-us_topic_0000001173789928_ad947f987a4ee420c89ffc4e013796c18">Fields to be reversed</p>
</td>
<td class="cellrowborder" valign="top" width="54.730000000000004%" headers="mcps1.3.3.2.2.6.1.2 "><p id="mrs_01_1141__en-us_topic_0000001173789928_ad1ef52316b8140a0829a0c89a37cb3c0">Information about fields for string reversal conversion:</p>
<ul id="mrs_01_1141__en-us_topic_0000001173789928_u32e2b0279ded4c58b393483ee72ac8a1"><li id="mrs_01_1141__en-us_topic_0000001173789928_l6b20abe119ae434cbbacb2e0a6387dc4"><span class="parmname" id="mrs_01_1141__en-us_topic_0000001173789928_p64977160f14342f5a8d81113698f75eb"><b>input field name</b></span>: Names of input fields. Set this parameter to the names of fields generated in the previous conversion step.</li><li id="mrs_01_1141__en-us_topic_0000001173789928_l9f0be62aed7c47c89159551d0363f75e"><span class="parmname" id="mrs_01_1141__en-us_topic_0000001173789928_p6b81f1a08fde41949074ee31b20c5ea7"><b>output field name</b></span>: Names of output fields.</li><li id="mrs_01_1141__en-us_topic_0000001173789928_le5b2c03f1f9549629e0bda3d5a48267e"><span class="parmname" id="mrs_01_1141__en-us_topic_0000001173789928_p8c9002a790aa40528f894d61c33a317d"><b>type</b></span>: Field type.</li><li id="mrs_01_1141__en-us_topic_0000001173789928_l57250a98a48b47c19709c0735146b758"><span class="parmname" id="mrs_01_1141__en-us_topic_0000001173789928_p66409aace97c4c6081f0367eb37ea7d4"><b>out field length</b></span>: Field value length. If the actual field value is excessively long, the value is cut based on the configured length. When <span class="parmname" id="mrs_01_1141__en-us_topic_0000001173789928_pc20f19964d3741b79cc72b7dff53aa2a"><b>type</b></span> is set to <span class="parmvalue" id="mrs_01_1141__en-us_topic_0000001173789928_p65752f02b8984cc8b6b82bda6a89b275"><b>CHAR</b></span>, spaces are added to the field value for supplement if the actual field value length is less than the configured length. When <span class="parmname" id="mrs_01_1141__en-us_topic_0000001173789928_pe2a903c56e8542548e5a4f1c905bcfbc"><b>type</b></span> is set to <span class="parmvalue" id="mrs_01_1141__en-us_topic_0000001173789928_p4d6f91739beb46c3b363b239774d2a76"><b>VARCHAR</b></span>, no space is added to the field value for supplement if the actual field value length is less than the configured length.</li></ul>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.3.3.2.2.6.1.3 "><p id="mrs_01_1141__en-us_topic_0000001173789928_a206f049c9e5a4389966caec93668c33e">map</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.4 "><p id="mrs_01_1141__en-us_topic_0000001173789928_afc61e99c04e447e78b19aa57185a91eb">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.5 "><p id="mrs_01_1141__en-us_topic_0000001173789928_a8d3d52a70542479dbe11cd6e21719597">None</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="mrs_01_1141__en-us_topic_0000001173789928_s9f5aeb68afdd476283e485dfe395a7bc"><h4 class="sectiontitle">Data Processing Rule</h4><ul id="mrs_01_1141__en-us_topic_0000001173789928_ue74e6c57067147bda2d4b43fda1d10d4"><li id="mrs_01_1141__en-us_topic_0000001173789928_l8d0cfd6a79f244dfbb928b1923dfa97a">Value reversal conversion is performed for fields.</li><li id="mrs_01_1141__en-us_topic_0000001173789928_le766f5c2a6fb486584fb1f7c7d488258">If the input data is null, no reversal conversion is performed.</li><li id="mrs_01_1141__en-us_topic_0000001173789928_l8fd43e8f8f094458a4f73c15a38f531b">If the number of input field columns is greater than the number of field columns actually included in the original data, all data becomes dirty data.</li></ul>
</div>
<div class="section" id="mrs_01_1141__en-us_topic_0000001173789928_s07df1690214d494dbe1c24f4b445b29a"><h4 class="sectiontitle">Example</h4><p id="mrs_01_1141__en-us_topic_0000001173789928_a9e4175038f77411dab70a3e5edc7bc7b">Use the <span class="parmname" id="mrs_01_1141__en-us_topic_0000001173789928_paf5077fd63224d4faf241f14a01a0e95"><b>CSV File Input</b></span> operator to generate fields A and B.</p>
<p id="mrs_01_1141__en-us_topic_0000001173789928_aa94f6bc0b1894bd39e3f7bd3869d4254">The following figure shows the source file.</p>
<pre class="screen" id="mrs_01_1141__screen1483997204312">abcd,product
FusionInsight,Bigdata</pre>
<p id="mrs_01_1141__en-us_topic_0000001173789928_a86eb945bff3945f38632f1e4e07d0098">Configure the <span class="parmname" id="mrs_01_1141__en-us_topic_0000001173789928_pc462932d9b964330a550369753882a1e"><b>String Reverse</b></span> operator to generate two new fields C and D.</p>
<p id="mrs_01_1141__en-us_topic_0000001173789928_a5aac232d91344313be6efe3432d3a93d"><span><img id="mrs_01_1141__en-us_topic_0000001173789928_i945faf96ce0a4e8db049f576a4c6b1a0" src="en-us_image_0000001349259393.png"></span></p>
<p id="mrs_01_1141__en-us_topic_0000001173789928_a4ba16928ca594d94982992f28a0aad91">After conversion, four fields are generated, as shown in the following figure.</p>
<pre class="screen" id="mrs_01_1141__screen15381202614467">abcd,product,dcba,tcudorp
FusionInsight,Bigdata,thgisnInoisuF,atadgiB</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_1130.html">Conversion Operators</a></div>
</div>
</div>