doc-exports/docs/dli/sqlreference/dli_08_0306.html
Su, Xiaomeng 04d4597cf3 dli_sqlreference_0511_version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
2023-11-02 14:34:08 +00:00

99 lines
10 KiB
HTML

<a name="dli_08_0306"></a><a name="dli_08_0306"></a>
<h1 class="topictitle1">HBase Source Table</h1>
<div id="body8662426"><div class="section" id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_section670892955410"><h4 class="sectiontitle">Function</h4><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p835216342549">Create a source stream to obtain data from HBase as input for jobs. HBase is a column-oriented distributed cloud storage system that features enhanced reliability, excellent performance, and elastic scalability. It applies to the storage of massive amounts of data and distributed computing. You can use HBase to build a storage system capable of storing TB- or even PB-level data. With HBase, you can filter and analyze data with ease and get responses in milliseconds, rapidly mining data value. DLI can read data from HBase for filtering, analysis, and data dumping.</p>
</div>
<div class="section" id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_section11337165518558"><h4 class="sectiontitle">Prerequisites</h4><ul id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_ul13179123403513"><li id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_li1817918345355">An enhanced datasource connection has been created for DLI to connect to HBase, so that jobs can run on the dedicated queue of DLI and you can set the security group rules as required.</li><li id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_li174225110214"><strong id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_b1780314476502">If MRS HBase is used, IP addresses of all hosts in the MRS cluster have been added to host information of the enhanced datasource connection.</strong><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p1435791362116">.</p>
<p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p1290940152113">For details, see section "Modifying the Host Information" in the <em id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_i209214542445825">Data Lake Insight User Guide</em>.</p>
</li></ul>
</div>
<div class="section" id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_section1198425395616"><h4 class="sectiontitle">Syntax</h4><pre class="screen" id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_screen344510125715">create table hbaseSource (
attr_name attr_type
(',' attr_name attr_type)*
(',' watermark for rowtime_column_name as watermark-strategy_expression)
)
with (
'connector.type' = 'hbase',
'connector.version' = '1.4.3',
'connector.table-name' = '',
'connector.zookeeper.quorum' = ''
);</pre>
</div>
<div class="section" id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_section11860133905818"><h4 class="sectiontitle">Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_table1792955835818" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_row39301258105810"><th align="left" class="cellrowborder" valign="top" width="22.81228122812281%" id="mcps1.3.4.2.2.4.1.1"><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p693025820588">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="9.63096309630963%" id="mcps1.3.4.2.2.4.1.2"><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p16930958155814">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="67.55675567556756%" id="mcps1.3.4.2.2.4.1.3"><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p493035816580">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_row129308583583"><td class="cellrowborder" valign="top" width="22.81228122812281%" headers="mcps1.3.4.2.2.4.1.1 "><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p393065810586">connector.type</p>
</td>
<td class="cellrowborder" valign="top" width="9.63096309630963%" headers="mcps1.3.4.2.2.4.1.2 "><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p12930175813580">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="67.55675567556756%" headers="mcps1.3.4.2.2.4.1.3 "><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p49301958175812">Connector type. Set this parameter to <strong id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_b9383155593">hbase</strong>.</p>
</td>
</tr>
<tr id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_row29301458155818"><td class="cellrowborder" valign="top" width="22.81228122812281%" headers="mcps1.3.4.2.2.4.1.1 "><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p12930185875810">connector.version</p>
</td>
<td class="cellrowborder" valign="top" width="9.63096309630963%" headers="mcps1.3.4.2.2.4.1.2 "><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p593015855820">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="67.55675567556756%" headers="mcps1.3.4.2.2.4.1.3 "><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p7930195885819">The value must be <strong id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_b1495235914">1.4.3</strong>.</p>
</td>
</tr>
<tr id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_row0930115825816"><td class="cellrowborder" valign="top" width="22.81228122812281%" headers="mcps1.3.4.2.2.4.1.1 "><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p199301358135815">connector. table-name</p>
</td>
<td class="cellrowborder" valign="top" width="9.63096309630963%" headers="mcps1.3.4.2.2.4.1.2 "><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p193085835811">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="67.55675567556756%" headers="mcps1.3.4.2.2.4.1.3 "><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p119302058165815">HBase table name</p>
</td>
</tr>
<tr id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_row109301158135816"><td class="cellrowborder" valign="top" width="22.81228122812281%" headers="mcps1.3.4.2.2.4.1.1 "><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p093015817586">connector.zookeeper.quorum</p>
</td>
<td class="cellrowborder" valign="top" width="9.63096309630963%" headers="mcps1.3.4.2.2.4.1.2 "><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p89301358155814">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="67.55675567556756%" headers="mcps1.3.4.2.2.4.1.3 "><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p19309586588">ZooKeeper address</p>
</td>
</tr>
<tr id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_row2930165875815"><td class="cellrowborder" valign="top" width="22.81228122812281%" headers="mcps1.3.4.2.2.4.1.1 "><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p1193025875815">connector.zookeeper.znode.parent</p>
</td>
<td class="cellrowborder" valign="top" width="9.63096309630963%" headers="mcps1.3.4.2.2.4.1.2 "><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p3930205865811">No</p>
</td>
<td class="cellrowborder" valign="top" width="67.55675567556756%" headers="mcps1.3.4.2.2.4.1.3 "><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p17930195815586">Root directory for ZooKeeper. The default value is <strong id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_b1061412401703">/hbase</strong>.</p>
</td>
</tr>
<tr id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_row793085813586"><td class="cellrowborder" valign="top" width="22.81228122812281%" headers="mcps1.3.4.2.2.4.1.1 "><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p6930458125816">connector.rowkey</p>
</td>
<td class="cellrowborder" valign="top" width="9.63096309630963%" headers="mcps1.3.4.2.2.4.1.2 "><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p1693025813582">No</p>
</td>
<td class="cellrowborder" valign="top" width="67.55675567556756%" headers="mcps1.3.4.2.2.4.1.3 "><p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p8168130925">Content of a compound rowkey to be assigned. The content is assigned to a new field based on the configuration.</p>
<p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p5168709211">Example: rowkey1:3,rowkey2:3,...</p>
<p id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_p61688011215">The value 3 indicates the first three bytes of the field. The number cannot be greater than the byte size of the field and cannot be less than 1. <strong id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_b10826123519416">rowkey1:3,rowkey2:3</strong> indicates that the first three bytes of the compound rowkey are assigned to <strong id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_b1048715014516">rowkey1</strong>, and the last three bytes are assigned to <strong id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_b147432119615">rowkey2</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_section61832384211"><h4 class="sectiontitle">Example</h4><pre class="screen" id="dli_08_0306__en-us_topic_0000001166031871_en-us_topic_0000001103642572_screen1537020461624">create table hbaseSource(
rowkey1 string,
rowkey2 string,
info Row&lt;owner string&gt;,
car ROW&lt;miles string, speed string&gt;
) with (
'connector.type' = 'hbase',
'connector.version' = '1.4.3',
'connector.table-name' = 'carinfo',
'connector.rowkey' = 'rowkey1:1,rowkey2:3',
'connector.zookeeper.quorum' = 'xxxx:2181'
);</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dli_08_0300.html">Creating a Source Table</a></div>
</div>
</div>