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

109 lines
14 KiB
HTML

<a name="mrs_01_1131"></a><a name="mrs_01_1131"></a>
<h1 class="topictitle1">Long Date Conversion</h1>
<div id="body8662426"><div class="section" id="mrs_01_1131__en-us_topic_0000001219149177_sba866072ab934392a1a8168876ba0aef"><h4 class="sectiontitle">Overview</h4><p id="mrs_01_1131__en-us_topic_0000001219149177_a94ffc79ccc2041bea117161c42145333">The <span class="parmname" id="mrs_01_1131__en-us_topic_0000001219149177_p93cba8793c4143bf963ee30a32d4a2de"><b>Long Date Conversion</b></span> operator performs long integer and date conversion.</p>
</div>
<div class="section" id="mrs_01_1131__en-us_topic_0000001219149177_s483b2f388c7b4af686730b75574f7340"><h4 class="sectiontitle">Input and Output</h4><ul id="mrs_01_1131__en-us_topic_0000001219149177_u4aa10b014adb49a08889db733e5eebe5"><li id="mrs_01_1131__en-us_topic_0000001219149177_l848d483601bd4af6bb82042fe52b0e87">Input: fields to be converted</li><li id="mrs_01_1131__en-us_topic_0000001219149177_l5d293dc822414defa0cf3b37cbc69c01">Output: new fields</li></ul>
</div>
<div class="section" id="mrs_01_1131__en-us_topic_0000001219149177_s25dd806f2d6544f9b87476bb07c1490a"><h4 class="sectiontitle">Parameter Description</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_1131__en-us_topic_0000001219149177_t532939dfe3df4790b8ed4dff23aa21cc" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Operator parameter description</caption><thead align="left"><tr id="mrs_01_1131__en-us_topic_0000001219149177_r5ff4bce3a27646b19159964a5e053a39"><th align="left" class="cellrowborder" valign="top" width="18.37%" id="mcps1.3.3.2.2.6.1.1"><p id="mrs_01_1131__en-us_topic_0000001219149177_a7cdbc9e0e8bf4abba661c6d8433d3b33">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_1131__en-us_topic_0000001219149177_a9d32ea9fdef247f5933e9699ac6b3057">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_1131__en-us_topic_0000001219149177_ab7c41d078cf9458cb3032e4a0416f122">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_1131__en-us_topic_0000001219149177_a46db272550a64687bc030501c57fab41">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_1131__en-us_topic_0000001219149177_a77046509c89b49908086614ea2637d46">Default Value</p>
</th>
</tr>
</thead>
<tbody><tr id="mrs_01_1131__en-us_topic_0000001219149177_r1f42be442db24534bb91eedb54e3fc8b"><td class="cellrowborder" valign="top" width="18.37%" headers="mcps1.3.3.2.2.6.1.1 "><p id="mrs_01_1131__en-us_topic_0000001219149177_a18a3100a78474f55bd01f62092b3bd7f">convert type</p>
</td>
<td class="cellrowborder" valign="top" width="54.730000000000004%" headers="mcps1.3.3.2.2.6.1.2 "><p id="mrs_01_1131__en-us_topic_0000001219149177_a53ca0a5b07244ea386e4ed17f46968f2">Types of long integer and date conversion:</p>
<ul id="mrs_01_1131__en-us_topic_0000001219149177_u9ad1e124b8be4e93a740940d03c63573"><li id="mrs_01_1131__en-us_topic_0000001219149177_l513b3ab51a1a431abfdcfd78cb62305e"><strong id="mrs_01_1131__en-us_topic_0000001219149177_ad6b37e9915d043ffa0a62a37a3c7efbc">long to date</strong>: converts long integers to date.</li><li id="mrs_01_1131__en-us_topic_0000001219149177_la45d76775bfe441fa1c7ec10efe30476"><strong id="mrs_01_1131__en-us_topic_0000001219149177_ad0d4d6f3357f49ddb579e18ede12e724">long to time</strong>: converts long integers to time.</li><li id="mrs_01_1131__en-us_topic_0000001219149177_led7627f419884ca48c36ac3cbdd3e6e1"><strong id="mrs_01_1131__en-us_topic_0000001219149177_aa399443f2a1144488cb689de8d4076cf">long to timestamp</strong>: converts long integers to timestamp.</li><li id="mrs_01_1131__en-us_topic_0000001219149177_l7f843d398af04303894af20aa74f510b"><strong id="mrs_01_1131__en-us_topic_0000001219149177_a0587cc467ca54d4baef549adb903a956">date to long</strong>: converts date to long integers.</li><li id="mrs_01_1131__en-us_topic_0000001219149177_lfe04c1d9f19c4bfd94e831d64f183666"><strong id="mrs_01_1131__en-us_topic_0000001219149177_a4abd835e70e54d28a582425679ff71bc">time to long</strong>: converts time to long integers.</li><li id="mrs_01_1131__en-us_topic_0000001219149177_lf309f88de0e34976af02e31abe075a37"><strong id="mrs_01_1131__en-us_topic_0000001219149177_a08149729d22d4fde88fd8d0bcb671267">timestamp to long</strong>: converts timestamp to long integers.</li></ul>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.3.3.2.2.6.1.3 "><p id="mrs_01_1131__en-us_topic_0000001219149177_aaa4c0b1581834de3890b2a2c97babe83">enum</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.4 "><p id="mrs_01_1131__en-us_topic_0000001219149177_a8f1fda2bd4d74dd8b3d6d59916f1c7b8">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.5 "><p id="mrs_01_1131__en-us_topic_0000001219149177_acd73eae5bf6a4de2a5e715f53a80a4b7">long to date</p>
</td>
</tr>
<tr id="mrs_01_1131__en-us_topic_0000001219149177_r75ea8d87bb4c44229b757b524b1a9d20"><td class="cellrowborder" valign="top" width="18.37%" headers="mcps1.3.3.2.2.6.1.1 "><p id="mrs_01_1131__en-us_topic_0000001219149177_a8d2dbb2428364ea4900519d23f1d6103">input field name</p>
</td>
<td class="cellrowborder" valign="top" width="54.730000000000004%" headers="mcps1.3.3.2.2.6.1.2 "><p id="mrs_01_1131__en-us_topic_0000001219149177_ad3f13e5c39dd4eec889d1740fed58765">Name of input fields to be converted. Set this parameter to the names of fields generated in the previous conversion step.</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.3.3.2.2.6.1.3 "><p id="mrs_01_1131__en-us_topic_0000001219149177_a4becf9dcd01d43e58f15bed333fa91a4">string</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.4 "><p id="mrs_01_1131__en-us_topic_0000001219149177_a77fcfd79f55b4d839fb66c9a8936b596">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.5 "><p id="mrs_01_1131__en-us_topic_0000001219149177_afd0c6416625a409cbeec33d1a8045615">None</p>
</td>
</tr>
<tr id="mrs_01_1131__en-us_topic_0000001219149177_r89ac2fcf0c6b4d72b9455afb7657e758"><td class="cellrowborder" valign="top" width="18.37%" headers="mcps1.3.3.2.2.6.1.1 "><p id="mrs_01_1131__en-us_topic_0000001219149177_a07ef002fe5ce4d50a0803a03edd09506">output field name</p>
</td>
<td class="cellrowborder" valign="top" width="54.730000000000004%" headers="mcps1.3.3.2.2.6.1.2 "><p id="mrs_01_1131__en-us_topic_0000001219149177_abbe5002180ae45b89fe8a0a7fc13be41">Names of output fields.</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.3.3.2.2.6.1.3 "><p id="mrs_01_1131__en-us_topic_0000001219149177_a999e22cecf4c4d91a8483e977ae41b84">string</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.4 "><p id="mrs_01_1131__en-us_topic_0000001219149177_aba14f1936aac41148ba843a688ee0c5c">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.5 "><p id="mrs_01_1131__en-us_topic_0000001219149177_ad77bebdcdda9437dba7e84c85e6a7359">None</p>
</td>
</tr>
<tr id="mrs_01_1131__en-us_topic_0000001219149177_r6ee84a2d8206408a9fda471c246d9c5e"><td class="cellrowborder" valign="top" width="18.37%" headers="mcps1.3.3.2.2.6.1.1 "><p id="mrs_01_1131__en-us_topic_0000001219149177_a51876ad54378436fb0f807c72c44147d">field unit</p>
</td>
<td class="cellrowborder" valign="top" width="54.730000000000004%" headers="mcps1.3.3.2.2.6.1.2 "><p id="mrs_01_1131__en-us_topic_0000001219149177_a34c91fbbe5b34c8e9dc1e9c69194bf08">Unit of a long integer field. According to <span class="parmname" id="mrs_01_1131__en-us_topic_0000001219149177_pf98365cc85344da58a9642ccffb21cee"><b>convert type</b></span>, the value is an input field or generated field. The options are <span class="parmvalue" id="mrs_01_1131__en-us_topic_0000001219149177_p269f3c2ab51c499ba8c88d11f7ad25ef"><b>second</b></span> and <span class="parmvalue" id="mrs_01_1131__en-us_topic_0000001219149177_pafd4877b204d40e38dbeb7ca1c63f8b6"><b>millisecond</b></span>.</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.3.3.2.2.6.1.3 "><p id="mrs_01_1131__en-us_topic_0000001219149177_a7207df118b2b4096af5c0c54fba1adf8">enum</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.4 "><p id="mrs_01_1131__en-us_topic_0000001219149177_a759fffda097e4cfd81f0b6db19d9001f">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.5 "><p id="mrs_01_1131__en-us_topic_0000001219149177_aba66c8cb6e5d4040963a11ec22f4802e">second</p>
</td>
</tr>
<tr id="mrs_01_1131__en-us_topic_0000001219149177_r3ec8c112da1147fca088cab1709ae013"><td class="cellrowborder" valign="top" width="18.37%" headers="mcps1.3.3.2.2.6.1.1 "><p id="mrs_01_1131__en-us_topic_0000001219149177_ac3d0f493c3da4c6999b4868a0481bf48">output field type</p>
</td>
<td class="cellrowborder" valign="top" width="54.730000000000004%" headers="mcps1.3.3.2.2.6.1.2 "><p id="mrs_01_1131__en-us_topic_0000001219149177_a9e700ea653274c07b95c52afdc2c1766">Output field type. The options are <span class="parmvalue" id="mrs_01_1131__en-us_topic_0000001219149177_pb73e9f23f4194521ae64bc93e8d1f422"><b>BIGINT</b></span>, <span class="parmvalue" id="mrs_01_1131__en-us_topic_0000001219149177_pd059d1dfc7de4f49a85b0a0cde56e37f"><b>DATE</b></span>, <span class="parmvalue" id="mrs_01_1131__en-us_topic_0000001219149177_p967d27b9309844fcb75bf6056e97e9bd"><b>TIME</b></span>, and <span class="parmvalue" id="mrs_01_1131__en-us_topic_0000001219149177_p26fab5605aba40b8873153ac3779c5a9"><b>TIMESTAMP</b></span>.</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.3.3.2.2.6.1.3 "><p id="mrs_01_1131__en-us_topic_0000001219149177_ad79e3b828d1a487180c26d1c52c29081">enum</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.4 "><p id="mrs_01_1131__en-us_topic_0000001219149177_a6535a4d8f1f9406993132a6abdb1c635">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.5 "><p id="mrs_01_1131__en-us_topic_0000001219149177_a3a16f6cc91d24212ad01ef06447be5ae">BIGINT</p>
</td>
</tr>
<tr id="mrs_01_1131__en-us_topic_0000001219149177_rbd6fbb206ca44c3fa59b0a0840e6e333"><td class="cellrowborder" valign="top" width="18.37%" headers="mcps1.3.3.2.2.6.1.1 "><p id="mrs_01_1131__en-us_topic_0000001219149177_a20ed6b35788d497190eb32427c9d6a68">date format</p>
</td>
<td class="cellrowborder" valign="top" width="54.730000000000004%" headers="mcps1.3.3.2.2.6.1.2 "><p id="mrs_01_1131__en-us_topic_0000001219149177_a02454dd2d7354dd4830e863a0386f324">Time field format, for example, <span class="filepath" id="mrs_01_1131__en-us_topic_0000001219149177_f92b0dec7a73e4b178ff63f98ae14d3e2"><b>yyyyMMdd HH:mm:ss</b></span>.</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.3.3.2.2.6.1.3 "><p id="mrs_01_1131__en-us_topic_0000001219149177_a82b58744ba454a13907f56e37bfc4d57">string</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.4 "><p id="mrs_01_1131__en-us_topic_0000001219149177_ad2d037eac0c642129f975c04c0742131">No</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.5 "><p id="mrs_01_1131__en-us_topic_0000001219149177_ae84385067f864e218c70626b6d2444f4">None</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="mrs_01_1131__en-us_topic_0000001219149177_s13903d508d284ea1bba3a65a53ca3089"><h4 class="sectiontitle">Data Processing Rule</h4><ul id="mrs_01_1131__en-us_topic_0000001219149177_ud3bede2a45a74184b2263db3ba79e44c"><li id="mrs_01_1131__en-us_topic_0000001219149177_lfa66c088a402480888c7a77b21852154">If the original data includes null values, no conversion is performed.</li><li id="mrs_01_1131__en-us_topic_0000001219149177_la1170b4f2ca644139c5a6bd7845eba64">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><li id="mrs_01_1131__en-us_topic_0000001219149177_l18bbab8c8eb94f8dbc9b3fd0686b31d7">If a type conversion error occurs, the current data is saved as dirty data.</li></ul>
</div>
<div class="section" id="mrs_01_1131__en-us_topic_0000001219149177_s4ae37e511a504e0ba671c703eed81ffd"><h4 class="sectiontitle">Example</h4><p id="mrs_01_1131__en-us_topic_0000001219149177_a6cf96ec5f99e44bbb18857377898282c">Use the <span class="parmname" id="mrs_01_1131__en-us_topic_0000001219149177_p77b3dec3d89f458c89d3e5d4a19970fe"><b>CSV File Input</b></span> operator to generate fields A and B.</p>
<p id="mrs_01_1131__en-us_topic_0000001219149177_a50145752ebdc4534a857c54586f37a8d">The following figure shows the source file.</p>
<p id="mrs_01_1131__en-us_topic_0000001219149177_a4ce576bcf0a34673a9a2c29721d49d59"><span><img id="mrs_01_1131__en-us_topic_0000001219149177_ia82c8dc64ded47b1a34b217ec043a56a" src="en-us_image_0000001349259249.jpg"></span></p>
<p id="mrs_01_1131__en-us_topic_0000001219149177_a44384ff258544038b3bbbdbd93082baf">Configure the <span class="parmname" id="mrs_01_1131__en-us_topic_0000001219149177_p71dcf8f2a8d1499ca86ffb07ed66ae8e"><b>Long Date Conversion</b></span> operator to generate four new fields C, D, E, and F. Their types are DATE, TIME, TIMESTAMP, and BIGINT, respectively.</p>
<p id="mrs_01_1131__en-us_topic_0000001219149177_a3836e6e47cf942feb1b6027c3c7fb291"><span><img id="mrs_01_1131__en-us_topic_0000001219149177_ie107afc24286453fbb52143e97bfb588" src="en-us_image_0000001349139657.png"></span></p>
<p id="mrs_01_1131__en-us_topic_0000001219149177_a2f63037cd6824273b5480a1bb42b201c">The following figure shows the output of the conversion.</p>
<p id="mrs_01_1131__en-us_topic_0000001219149177_a77f27128e38c46959c9d7e6b8e231f8e"><span><img id="mrs_01_1131__en-us_topic_0000001219149177_i2c4eff3b396443ebaadaf5d2c9c4d21a" src="en-us_image_0000001295900108.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>