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>
36 lines
2.4 KiB
HTML
36 lines
2.4 KiB
HTML
<a name="mrs_01_2335"></a><a name="mrs_01_2335"></a>
|
|
|
|
<h1 class="topictitle1">HetuEngine Cross-Domain Function Usage</h1>
|
|
<div id="body32001227"><ol id="mrs_01_2335__en-us_topic_0000001219350545_ol778725116315"><li id="mrs_01_2335__en-us_topic_0000001219350545_li187871051143115"><span>Open the data source in the local domain. You can create a virtual schema to shield the real schema information and instance information of the physical data source in the local domain from remote access requests. The remote end can use the virtual schema name to access the data source in the local domain.</span><p><pre class="screen" id="mrs_01_2335__en-us_topic_0000001219350545_screen13192193631212">CREATE VIRTUAL SCHEMA hive01.vschema01 WITH (
|
|
catalog = 'hive01',
|
|
schema = 'ins1'
|
|
);</pre>
|
|
</p></li><li id="mrs_01_2335__en-us_topic_0000001219350545_li6512195723117"><span>Register the data source of the <span id="mrs_01_2335__en-us_topic_0000001219350545_text45131611186">HetuEngine</span> type on the remote <span id="mrs_01_2335__en-us_topic_0000001219350545_text9142121512181">HetuEngine</span> and add the local domain <span id="mrs_01_2335__en-us_topic_0000001219350545_text187021816141818">HetuEngine</span> by referring to <a href="mrs_01_1719.html">Configuring a HetuEngine Data Source</a>.</span></li><li id="mrs_01_2335__en-us_topic_0000001219350545_li17190152618139"><span>Use cross-domain collaborative analysis.</span><p><pre class="screen" id="mrs_01_2335__en-us_topic_0000001219350545_screen145595291311">// 1. Open the <strong id="mrs_01_2335__en-us_topic_0000001219350545_b18235422498">hive1.ins2</strong> data source on the remote HetuEngine.
|
|
CREATE VIRTUAL SCHEMA hive1.vins2 WITH (
|
|
catalog = 'hive1',
|
|
schema = 'ins2'
|
|
);
|
|
|
|
// 2. Register three types of data sources, including Hive, GaussDB A, and HetuEngine, on HetuEngine in the local domain.
|
|
hetuengine> show catalogs;
|
|
Catalog
|
|
----------
|
|
dws
|
|
hetuengine_dc
|
|
hive
|
|
hive_dg
|
|
system
|
|
systemremote
|
|
(6 rows)
|
|
|
|
// 3. Perform cross-source collaborative analysis on HetuEngine in the local domain.
|
|
select * from hive_dg.schema1.table1 t1 join hetuengine_dc.vins2.table3 t2 join dws.schema02.table4 t3 on t1.name = t2.item and t2.id = t3.cardNo;</pre>
|
|
</p></li></ol>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_2342.html">Using HetuEngine Cross-Domain Function</a></div>
|
|
</div>
|
|
</div>
|
|
|