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>
54 lines
8.1 KiB
HTML
54 lines
8.1 KiB
HTML
<a name="mrs_01_1133"></a><a name="mrs_01_1133"></a>
|
|
|
|
<h1 class="topictitle1">Constant Field Addition</h1>
|
|
<div id="body8662426"><div class="section" id="mrs_01_1133__en-us_topic_0000001173789178_sbc25d8c87f1041d4bf202bb7912e64c2"><h4 class="sectiontitle">Overview</h4><p id="mrs_01_1133__en-us_topic_0000001173789178_af7f27eaecdad42c8a68eee5cefe7a73d">The <span class="parmname" id="mrs_01_1133__en-us_topic_0000001173789178_p653cb326ca6f472f893e44bd82b72f5b"><b>Add Constants</b></span> operator generates constant fields.</p>
|
|
</div>
|
|
<div class="section" id="mrs_01_1133__en-us_topic_0000001173789178_sce20024dc44840f1bc51e1fc04c38140"><h4 class="sectiontitle">Input and Output</h4><ul id="mrs_01_1133__en-us_topic_0000001173789178_u7e2b4997d8fb4b77b5e18cb6bf0863ab"><li id="mrs_01_1133__en-us_topic_0000001173789178_l5181e7a9641a48a9a0ec9bf21531940f">Input: none</li><li id="mrs_01_1133__en-us_topic_0000001173789178_le8795e7029f4425cb7b0882307e7967c">Output: constant fields</li></ul>
|
|
</div>
|
|
<div class="section" id="mrs_01_1133__en-us_topic_0000001173789178_s4d725d95cacd4fb0ab2379954c39b6e0"><h4 class="sectiontitle">Parameter Description</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_1133__en-us_topic_0000001173789178_t3f226bb973cb4a8dbab12b025f868eb3" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Operator parameters description</caption><thead align="left"><tr id="mrs_01_1133__en-us_topic_0000001173789178_r78b1576e21584d43b4529f825954deda"><th align="left" class="cellrowborder" valign="top" width="18.37%" id="mcps1.3.3.2.2.6.1.1"><p id="mrs_01_1133__en-us_topic_0000001173789178_a7e5b7ecd57a14c829f6387fc142cacc1">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_1133__en-us_topic_0000001173789178_ac49215ec377640858011d490787303ff">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_1133__en-us_topic_0000001173789178_a07dcb483110b4a53a0b6f61912b6579c">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_1133__en-us_topic_0000001173789178_ad8aa1b1c966f446fa279c5e40f4e765c">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_1133__en-us_topic_0000001173789178_a1e5e16ad75534e6c893a8d6f5fc2a763">Default Value</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="mrs_01_1133__en-us_topic_0000001173789178_r8684945d91164b97ae7e18d3f446e6fe"><td class="cellrowborder" valign="top" width="18.37%" headers="mcps1.3.3.2.2.6.1.1 "><p id="mrs_01_1133__en-us_topic_0000001173789178_a77fc7c03fd7e40a28a5359faa92f8874">Constant fields</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.730000000000004%" headers="mcps1.3.3.2.2.6.1.2 "><p id="mrs_01_1133__en-us_topic_0000001173789178_ac573a16ab419447f97dbe0e387ae2fd7">Information about constant fields:</p>
|
|
<ul id="mrs_01_1133__en-us_topic_0000001173789178_u328d1bf75aae4aeabbbc2529e0d926af"><li id="mrs_01_1133__en-us_topic_0000001173789178_lbc0f045ab7fe477fb1a676933505f1d3"><strong id="mrs_01_1133__en-us_topic_0000001173789178_b143396182049">output field name</strong>: Names of the configured fields.</li><li id="mrs_01_1133__en-us_topic_0000001173789178_l68c15a6c4fbd4425b2ad91ec20fbe15e"><strong id="mrs_01_1133__en-us_topic_0000001173789178_b533781312104052">type</strong>: field type</li><li id="mrs_01_1133__en-us_topic_0000001173789178_le85505ac219340bbab41bc764d3e6037"><strong id="mrs_01_1133__en-us_topic_0000001173789178_b13883451641">date format</strong>: If the field type is <span class="parmvalue" id="mrs_01_1133__en-us_topic_0000001173789178_parmvalue119418459419"><b>DATE</b></span>, <span class="parmvalue" id="mrs_01_1133__en-us_topic_0000001173789178_parmvalue195114516411"><b>TIME</b></span>, or <span class="parmvalue" id="mrs_01_1133__en-us_topic_0000001173789178_parmvalue39518459417"><b>TIMESTAMP</b></span>, you need to specify the time format. If the field type is neither of them, the time format is invalid. The example time format is <span class="filepath" id="mrs_01_1133__en-us_topic_0000001173789178_filepath1111223115517"><b>yyyyMMdd HH:mm:ss</b></span>.</li><li id="mrs_01_1133__en-us_topic_0000001173789178_l0236e7d5111e4c439b48bbbdc2a562f8"><strong id="mrs_01_1133__en-us_topic_0000001173789178_b978513354519">length</strong>: 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_1133__en-us_topic_0000001173789178_parmname479103513520"><b>type</b></span> is set to <span class="parmvalue" id="mrs_01_1133__en-us_topic_0000001173789178_parmvalue7791123512510"><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_1133__en-us_topic_0000001173789178_parmname1179219351655"><b>type</b></span> is set to <span class="parmvalue" id="mrs_01_1133__en-us_topic_0000001173789178_parmvalue47922351453"><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><li id="mrs_01_1133__en-us_topic_0000001173789178_lfdcdcdc7288742248451217b10835bbc"><strong id="mrs_01_1133__en-us_topic_0000001173789178_b1665798762">constant value</strong>: Constant value of the correct type.</li></ul>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.3.3.2.2.6.1.3 "><p id="mrs_01_1133__en-us_topic_0000001173789178_aad511cbbfb7243cca05317baedba805c">map</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.4 "><p id="mrs_01_1133__en-us_topic_0000001173789178_affb71a1c1653477dbc62a827a940a234">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.5 "><p id="mrs_01_1133__en-us_topic_0000001173789178_a2a5b771b6dd94d1fbf3d424cd740fd61">None</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="mrs_01_1133__en-us_topic_0000001173789178_s36d4f46cd61b42a98540103686e2294c"><h4 class="sectiontitle">Data Processing Rule</h4><p id="mrs_01_1133__en-us_topic_0000001173789178_af83b23f509314474a0b639c3313ba554">This operator generates constant fields of the specified type.</p>
|
|
</div>
|
|
<div class="section" id="mrs_01_1133__en-us_topic_0000001173789178_s9011101da5bf43ac81e8043e3aac3507"><h4 class="sectiontitle">Example</h4><p id="mrs_01_1133__en-us_topic_0000001173789178_a04737542c2874f76921e8d3e4a4f0d5c">Use the <span class="parmname" id="mrs_01_1133__en-us_topic_0000001173789178_p4702f125ca3443bf80a8b84bba584acf"><b>CSV File Input</b></span> operator to generate two fields A and B.</p>
|
|
<p id="mrs_01_1133__en-us_topic_0000001173789178_adaa3ce6a0304451c954e22b3ee9a4c44">The following figure shows the source file.</p>
|
|
<p id="mrs_01_1133__en-us_topic_0000001173789178_a4487a77c5bc6421a9a2dabb75fdd730e"><span><img id="mrs_01_1133__en-us_topic_0000001173789178_i0350cf2088114ddd95ffd97ca6e52b8d" src="en-us_image_0000001349259117.jpg"></span></p>
|
|
<p id="mrs_01_1133__en-us_topic_0000001173789178_ae3df56a8f8c5435e812651c84e34e740">Configure the <span class="parmname" id="mrs_01_1133__en-us_topic_0000001173789178_p3ce528c565b74ac1a1cca5612eb429da"><b>Add Constants</b></span> operator to add fields C and D.</p>
|
|
<p id="mrs_01_1133__en-us_topic_0000001173789178_a2107785f3c8f460da7dd73ab60edfd47"><span><img id="mrs_01_1133__en-us_topic_0000001173789178_id57cdcac25f94187baa236ee4031275f" src="en-us_image_0000001348739841.png"></span></p>
|
|
<p id="mrs_01_1133__en-us_topic_0000001173789178_a20a854afc516481b97614556b8f94f48">After adding the constants, fields A, B, C, and D are generated, as shown in the following figure.</p>
|
|
<p id="mrs_01_1133__en-us_topic_0000001173789178_aa47df0a3906743d0967995ed586c9e57"><span><img id="mrs_01_1133__en-us_topic_0000001173789178_i644362b9565a481ba2893b4cd991c37e" src="en-us_image_0000001295899980.jpg"></span></p>
|
|
</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>
|
|
|