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

77 lines
12 KiB
HTML

<a name="mrs_01_1150"></a><a name="mrs_01_1150"></a>
<h1 class="topictitle1">HBase Output</h1>
<div id="body8662426"><div class="section" id="mrs_01_1150__en-us_topic_0000001173630890_sa4409d226a45452d9737679221639361"><h4 class="sectiontitle">Overview</h4><p id="mrs_01_1150__en-us_topic_0000001173630890_a0311f7deda81412a8600259569430216">The <span class="parmname" id="mrs_01_1150__en-us_topic_0000001173630890_p542c5d951e4e45aa997878fe63219d38"><b>HBase Output</b></span> operator exports existing fields to specified columns of an HBase Outputtable.</p>
</div>
<div class="section" id="mrs_01_1150__en-us_topic_0000001173630890_s5715fa96c64f454ea8a9e5e65a2164df"><h4 class="sectiontitle">Input and Output</h4><ul id="mrs_01_1150__en-us_topic_0000001173630890_ua633b7c4ae8543e6af4e377af4c7a4e7"><li id="mrs_01_1150__en-us_topic_0000001173630890_l37c70e79435b46229cbcdc2923e5b3e6">Input: fields to be exported</li><li id="mrs_01_1150__en-us_topic_0000001173630890_l8284b943ec814b9b988d23a113ff8b61">Output: HBase table</li></ul>
</div>
<div class="section" id="mrs_01_1150__en-us_topic_0000001173630890_s89e855f5dcc84e469d4829e05988d9aa"><h4 class="sectiontitle">Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_1150__en-us_topic_0000001173630890_t27da1d11197f4150a4317a5dc555ca35" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Operator parameters description</caption><thead align="left"><tr id="mrs_01_1150__en-us_topic_0000001173630890_r001a62a2acd04a409136327382ca44e5"><th align="left" class="cellrowborder" valign="top" width="18.37%" id="mcps1.3.3.2.2.6.1.1"><p id="mrs_01_1150__en-us_topic_0000001173630890_aae1e36d735b640f388aa8ee16bc5da3f">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_1150__en-us_topic_0000001173630890_ad7d1923bca974c47a2abd4b22c03d1ca">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_1150__en-us_topic_0000001173630890_a4d8f7cbd8af644a8b1cc86618ae4432a">Node 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_1150__en-us_topic_0000001173630890_a7bbfea69f3654a9482e6ab4db8c8d4c3">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_1150__en-us_topic_0000001173630890_a7cf75b8014cc4f38bd5a759e9178da08">Default Value</p>
</th>
</tr>
</thead>
<tbody><tr id="mrs_01_1150__en-us_topic_0000001173630890_r1bd190003e584fd084ba1c244afdffa1"><td class="cellrowborder" valign="top" width="18.37%" headers="mcps1.3.3.2.2.6.1.1 "><p id="mrs_01_1150__en-us_topic_0000001173630890_aacd44482cbde45e59fa9b431c427f8e2">HBase table type</p>
</td>
<td class="cellrowborder" valign="top" width="54.730000000000004%" headers="mcps1.3.3.2.2.6.1.2 "><p id="mrs_01_1150__en-us_topic_0000001173630890_aa153fac4cecc4cf0bd1f45d0e5e57c82">HBase table type. The options include normal (common HBase table) and phoenix.</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.3.3.2.2.6.1.3 "><p id="mrs_01_1150__en-us_topic_0000001173630890_ac159d691d73049b98360fa0ab8625b59">enum</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.4 "><p id="mrs_01_1150__en-us_topic_0000001173630890_a40291d0d94cb49f489e5fd6841e3dbac">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.5 "><p id="mrs_01_1150__en-us_topic_0000001173630890_a0aaedb19e52e4841b581650973bc1b71">normal</p>
</td>
</tr>
<tr id="mrs_01_1150__en-us_topic_0000001173630890_r6acdc088c0814fe19c0c7587d3c032de"><td class="cellrowborder" valign="top" width="18.37%" headers="mcps1.3.3.2.2.6.1.1 "><p id="mrs_01_1150__en-us_topic_0000001173630890_aa0f141bbcb3d4c558ea13714e9819b12">NULL value processing mode</p>
</td>
<td class="cellrowborder" valign="top" width="54.730000000000004%" headers="mcps1.3.3.2.2.6.1.2 "><p id="mrs_01_1150__en-us_topic_0000001173630890_a911ef3e9543448a5bd19055cb53d3684">Null value processing mode. Selecting the option button indicates to convert null values to empty strings and save them. Deselecting the option button indicates the data is not saved.</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.3.3.2.2.6.1.3 "><p id="mrs_01_1150__en-us_topic_0000001173630890_a1d4cd202431c42bab5185e946cd736f9">boolean</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.4 "><p id="mrs_01_1150__en-us_topic_0000001173630890_a5456744ba89c4e8a90bbc8d0f66cf9d8">No</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.5 "><p id="mrs_01_1150__en-us_topic_0000001173630890_a5305c7dacb444dd9a52424627fe8f2c4">The option button is not selected.</p>
</td>
</tr>
<tr id="mrs_01_1150__en-us_topic_0000001173630890_rc6e9ac6c5ad14e6fa2dbd2f576d14bf3"><td class="cellrowborder" valign="top" width="18.37%" headers="mcps1.3.3.2.2.6.1.1 "><p id="mrs_01_1150__en-us_topic_0000001173630890_ae09569722fc44ec59404ff6b20e44deb">HBase output fields</p>
</td>
<td class="cellrowborder" valign="top" width="54.730000000000004%" headers="mcps1.3.3.2.2.6.1.2 "><p id="mrs_01_1150__en-us_topic_0000001173630890_a03c43a66a4ab46619c6b4f7c8c75f78e">HBase output information:</p>
<ul id="mrs_01_1150__en-us_topic_0000001173630890_u7aa9afafd949450d911a05c2722f5147"><li id="mrs_01_1150__en-us_topic_0000001173630890_l786498de4aa64703b81c727789b53c77">field name: Names of output fields.</li><li id="mrs_01_1150__en-us_topic_0000001173630890_l77b027c71c924ae3bf803f7bea27bbee">table name: HBase table name.</li><li id="mrs_01_1150__en-us_topic_0000001173630890_lda8e9431ef614188a2dded9898298e9b">family name: HBase column family name.</li><li id="mrs_01_1150__en-us_topic_0000001173630890_l57cf96e48d9b442e9674bfa3e5542aab">column name: HBase column name.</li><li id="mrs_01_1150__en-us_topic_0000001173630890_l66db10e85c5a42a596536dba327a8187">type: Field type. If type is set to <span class="parmvalue" id="mrs_01_1150__en-us_topic_0000001173630890_parmvalue162532815591343"><b>DATE</b></span>, <span class="parmvalue" id="mrs_01_1150__en-us_topic_0000001173630890_parmvalue10419047291343"><b>TIME</b></span>, or <span class="parmvalue" id="mrs_01_1150__en-us_topic_0000001173630890_parmvalue15882349891343"><b>TIMESTAMP</b></span>, you must specify a time format. If type is set to other values, the time format is invalid. An example time format is <span class="filepath" id="mrs_01_1150__en-us_topic_0000001173630890_f5f8adcbbe01c4724846c67b0cacc9769"><b>yyyyMMdd HH:mm:ss</b></span>.</li><li id="mrs_01_1150__en-us_topic_0000001173630890_l81a9f135efa34cae9b98bde31ac3ec0b">length: 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_1150__en-us_topic_0000001173630890_parmname2448151318324"><b>type</b></span> is set to <span class="parmvalue" id="mrs_01_1150__en-us_topic_0000001173630890_parmvalue54488136322"><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_1150__en-us_topic_0000001173630890_parmname1344931316328"><b>type</b></span> is set to <span class="parmvalue" id="mrs_01_1150__en-us_topic_0000001173630890_parmvalue4449111373216"><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_1150__en-us_topic_0000001173630890_l61feabaccfdc43118d5d57ba57fd2504">Primary Key: Indicates whether a column is a primary key column. A common HBase table can have only one primary key, while a phoenix table can have multiple primary keys. If multiple primary keys are configured, they are combined according to the configuration sequence. At least one primary key column must be configured.</li></ul>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.3.3.2.2.6.1.3 "><p id="mrs_01_1150__en-us_topic_0000001173630890_a31ada43ad87145648434674c67202f50">map</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.4 "><p id="mrs_01_1150__en-us_topic_0000001173630890_ab18d23aa78104477b66b8ac4150ce092">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="9.69%" headers="mcps1.3.3.2.2.6.1.5 "><p id="mrs_01_1150__en-us_topic_0000001173630890_a2cabeac40d2648cf900263b663330700">None</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="mrs_01_1150__en-us_topic_0000001173630890_s75be7fbf35384e92b0b5ef793530127d"><h4 class="sectiontitle">Data Processing Rule</h4><ul id="mrs_01_1150__en-us_topic_0000001173630890_u2e4f0e9acc154b47b52a262fd7ff0bfe"><li id="mrs_01_1150__en-us_topic_0000001173630890_l3293a8e18fa94417ad1931f24a7975f2">The field values are exported to the HBase table.</li><li id="mrs_01_1150__en-us_topic_0000001173630890_lce36244706284a23b1f41ecacd05cdc7">When the original data contains NULL values, if the <span class="parmname" id="mrs_01_1150__en-us_topic_0000001173630890_p69ea61f2e33042018dd361c29ed9d2c9"><b>NULL value processing mode</b></span> is selected, the NULL values are converted to empty strings and saved. If the <span class="parmname" id="mrs_01_1150__en-us_topic_0000001173630890_p0671e8dd59e24f1f8dc511c66d92f39d"><b>NULL value processing mode</b></span> button is not selected, the data is not saved.</li></ul>
</div>
<div class="section" id="mrs_01_1150__en-us_topic_0000001173630890_s8090f65807044fecb01ff0ab351ff75f"><h4 class="sectiontitle">Example</h4><p id="mrs_01_1150__en-us_topic_0000001173630890_a8b76237df2f74f03969dfb773e7ecc9b">Using table input as an example, after the fields are generated, the HBase Output operator exports them to the related HBase table and stores the data in the test table, as shown in the following figure.</p>
<p id="mrs_01_1150__en-us_topic_0000001173630890_a92bf18c199bf437b80ae488fdac13812"><span><img id="mrs_01_1150__en-us_topic_0000001173630890_ib459ca0411b94e72999d1fb4b6d6f6c5" src="en-us_image_0000001296219468.jpg"></span></p>
<p id="mrs_01_1150__en-us_topic_0000001173630890_p6564144725415">Create an HBase table.</p>
<p id="mrs_01_1150__en-us_topic_0000001173630890_aed6dc009b0cc424f8165bc9095cf96df"><strong id="mrs_01_1150__en-us_topic_0000001173630890_afac9126be1bf469985637722f6591571">create 'hbase_test','f1','f2'</strong><strong id="mrs_01_1150__en-us_topic_0000001173630890_b5496194611578">;</strong></p>
<p id="mrs_01_1150__en-us_topic_0000001173630890_adca00551e87c470089c58545b2df24e2">Configure the <span class="parmname" id="mrs_01_1150__en-us_topic_0000001173630890_pc426fc1b051e4e0c97f1b0216d4d1e4c"><b>HBase Output</b></span> operator, as shown in the following figure.</p>
<p id="mrs_01_1150__en-us_topic_0000001173630890_a535d2ae5db9c4a2cb3955427cc987a59"><span><img id="mrs_01_1150__en-us_topic_0000001173630890_i6a7ff327828042babd2954e942c6091f" src="en-us_image_0000001296059836.png"></span></p>
<p id="mrs_01_1150__en-us_topic_0000001173630890_abac011b6bf374055987f1bad8db9ded2">After the job execution is complete, view the data in the hbase_test table.</p>
<p id="mrs_01_1150__en-us_topic_0000001173630890_a03c3746ce1bc4c6cb70afa43292e8298"><span><img id="mrs_01_1150__en-us_topic_0000001173630890_i1a6180b871944b47b000342a16055822" src="en-us_image_0000001295740028.jpg"></span></p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_1145.html">Output Operators</a></div>
</div>
</div>