doc-exports/docs/dli/sqlreference/dli_08_0392.html
Su, Xiaomeng 76a5b1ee83 dli_sqlreference_20240227
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>
2024-03-27 22:02:33 +00:00

70 lines
5.8 KiB
HTML

<a name="dli_08_0392"></a><a name="dli_08_0392"></a>
<h1 class="topictitle1">BlackHole Result Table</h1>
<div id="body8662426"><div class="section" id="dli_08_0392__en-us_topic_0000001309855873_section1690311610180"><h4 class="sectiontitle">Function</h4><p id="dli_08_0392__en-us_topic_0000001309855873_p2972193021813">The BlackHole connector allows for swallowing all input records. It is designed for high-performance testing and UDF output. It is not a substantive sink. The BlackHole result table is a built-in connector.</p>
<p id="dli_08_0392__en-us_topic_0000001309855873_p1563744510250">For example, if an error is reported when you register a result table of another type, but you are not sure whether it is caused by a system fault or an invalid setting of the <strong id="dli_08_0392__en-us_topic_0000001309855873_b19159185244420">WITH</strong> parameter for the result table, you can change the value of <strong id="dli_08_0392__en-us_topic_0000001309855873_b2050220540467">connector</strong> to <strong id="dli_08_0392__en-us_topic_0000001309855873_b3868155824619">blackhole</strong> and click <strong id="dli_08_0392__en-us_topic_0000001309855873_b973932104613">Run</strong>. If no error is reported, the system is normal. You must check the settings of the <strong id="dli_08_0392__en-us_topic_0000001309855873_b438405564717">WITH</strong> parameter.</p>
</div>
<div class="section" id="dli_08_0392__en-us_topic_0000001309855873_section9803174120187"><h4 class="sectiontitle">Prerequisites</h4><p id="dli_08_0392__en-us_topic_0000001309855873_p1871011465189">None</p>
</div>
<div class="section" id="dli_08_0392__en-us_topic_0000001309855873_section148237491187"><h4 class="sectiontitle">Precautions</h4><p id="dli_08_0392__en-us_topic_0000001309855873_p187684582717">When creating a Flink OpenSource SQL job, you need to set <strong id="dli_08_0392__en-us_topic_0000001309855873_b6434183164810">Flink Version</strong> to <strong id="dli_08_0392__en-us_topic_0000001309855873_b1343415313487">1.12</strong> on the <strong id="dli_08_0392__en-us_topic_0000001309855873_b1143413311481">Running Parameters</strong> tab of the job editing page, select <strong id="dli_08_0392__en-us_topic_0000001309855873_b64351731184813">Save Job Log</strong>, and set the OBS bucket for saving job logs.</p>
</div>
<div class="section" id="dli_08_0392__en-us_topic_0000001309855873_section957685241810"><h4 class="sectiontitle">Syntax</h4><pre class="screen" id="dli_08_0392__en-us_topic_0000001309855873_screen16381051114519">create table blackhole_table (
attr_name attr_type (',' attr_name attr_type) *
) with (
'connector' = 'blackhole'
);</pre>
</div>
<div class="section" id="dli_08_0392__en-us_topic_0000001309855873_section144601444141917"><h4 class="sectiontitle">Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_08_0392__en-us_topic_0000001309855873_table11150132674218" frame="border" border="1" rules="all"><caption><b>Table 1 </b></caption><thead align="left"><tr id="dli_08_0392__en-us_topic_0000001309855873_row1315012260424"><th align="left" class="cellrowborder" valign="top" width="15.03%" id="mcps1.3.5.2.2.6.1.1"><p id="dli_08_0392__en-us_topic_0000001309855873_p1615010263424">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22.45%" id="mcps1.3.5.2.2.6.1.2"><p id="dli_08_0392__en-us_topic_0000001309855873_p13151182610428">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="26.490000000000002%" id="mcps1.3.5.2.2.6.1.3"><p id="dli_08_0392__en-us_topic_0000001309855873_p1559183013435">Default Value</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12.75%" id="mcps1.3.5.2.2.6.1.4"><p id="dli_08_0392__en-us_topic_0000001309855873_p13151132654213">Data Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="23.28%" id="mcps1.3.5.2.2.6.1.5"><p id="dli_08_0392__en-us_topic_0000001309855873_p7632058174317">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_08_0392__en-us_topic_0000001309855873_row16151202694216"><td class="cellrowborder" valign="top" width="15.03%" headers="mcps1.3.5.2.2.6.1.1 "><p id="dli_08_0392__en-us_topic_0000001309855873_p147914223449">connector</p>
</td>
<td class="cellrowborder" valign="top" width="22.45%" headers="mcps1.3.5.2.2.6.1.2 "><p id="dli_08_0392__en-us_topic_0000001309855873_p1600926144412">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="26.490000000000002%" headers="mcps1.3.5.2.2.6.1.3 "><p id="dli_08_0392__en-us_topic_0000001309855873_p13132205564220">None</p>
</td>
<td class="cellrowborder" valign="top" width="12.75%" headers="mcps1.3.5.2.2.6.1.4 "><p id="dli_08_0392__en-us_topic_0000001309855873_p715119269424">String</p>
</td>
<td class="cellrowborder" valign="top" width="23.28%" headers="mcps1.3.5.2.2.6.1.5 "><p id="dli_08_0392__en-us_topic_0000001309855873_p56331658154318">Connector to be used. Set this parameter to <strong id="dli_08_0392__en-us_topic_0000001309855873_b06673710491">blackhole</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="dli_08_0392__en-us_topic_0000001309855873_section2065545012199"><h4 class="sectiontitle">Example</h4><p id="dli_08_0392__en-us_topic_0000001309855873_p1235813299414">The DataGen source table generates data, and the BlackHole result table receives the data.</p>
<pre class="screen" id="dli_08_0392__en-us_topic_0000001309855873_screen768166163112">create table datagenSource (
user_id string,
user_name string,
user_age int
) with (
'connector' = 'datagen',
'rows-per-second'='1'
);
create table blackholeSink (
user_id string,
user_name string,
user_age int
) with (
'connector' = 'blackhole'
);
insert into blackholeSink select * from datagenSource;</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dli_08_0391.html">Creating Result Tables</a></div>
</div>
</div>