Yang, Tong 6182f91ba8 MRS component operation guide_normal 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>
2022-12-09 14:55:21 +00:00

47 lines
8.5 KiB
HTML

<a name="mrs_01_0635"></a><a name="mrs_01_0635"></a>
<h1 class="topictitle1">Using Presto to Dump Data in DLF</h1>
<div id="body1589421630835"><div class="section" id="mrs_01_0635__section17912151442419"><h4 class="sectiontitle">Prerequisites</h4><ul id="mrs_01_0635__ul98691357245"><li id="mrs_01_0635__li73511011313">The Presto component has been installed in an MRS cluster.</li><li id="mrs_01_0635__li8425103922415">You have synchronized IAM users. (On the <strong id="mrs_01_0635__b9684213115016">Dashboard</strong> page, click <strong id="mrs_01_0635__b10684161311509">Synchronize</strong> on the right side of <span class="parmname" id="mrs_01_0635__parmname2684113145010"><b>IAM User Sync</b></span> to synchronize IAM users.)</li><li id="mrs_01_0635__li188756224307">You have the permission to operate the OBS file system. For details, see and .</li><li id="mrs_01_0635__li14547844685">The Presto permission has been configured. For details, see <a href="mrs_01_0636.html">Configuring Presto Permissions</a>.</li></ul>
</div>
<div class="section" id="mrs_01_0635__section2028018713307"><a name="mrs_01_0635__section2028018713307"></a><a name="section2028018713307"></a><h4 class="sectiontitle">Creating a Data Connection of the MRS PrestoSQL Type in DLF</h4><ol id="mrs_01_0635__ol159629614337"><li id="mrs_01_0635__li7378101814911"><span>In the left navigation pane of the DLF console, choose <strong id="mrs_01_0635__b74665891692625">Connection</strong> &gt; <strong id="mrs_01_0635__b182127738592625">Manage Connection</strong>.</span></li><li id="mrs_01_0635__li72777013913"><span>In the upper right corner of the page, click <span class="uicontrol" id="mrs_01_0635__uicontrol196682002992625"><b>Create Data Connection</b></span>.</span></li><li id="mrs_01_0635__li1788311514143"><span>Set parameters according to <a href="#mrs_01_0635__table487712591418">Table 1</a>.</span><p>
<div class="tablenoborder"><a name="mrs_01_0635__table487712591418"></a><a name="table487712591418"></a><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_0635__table487712591418" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters for creating a data connection</caption><thead align="left"><tr id="mrs_01_0635__row287813541410"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.2.2.3.2.1.2.3.1.1"><p id="mrs_01_0635__p1687816512140">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.2.2.3.2.1.2.3.1.2"><p id="mrs_01_0635__p387814518143">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="mrs_01_0635__row1787911511142"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.2.1.2.3.1.1 "><p id="mrs_01_0635__p08791552148">Data Connection Type</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.2.1.2.3.1.2 "><p id="mrs_01_0635__p987913531417">Select <strong id="mrs_01_0635__b42641299492625">MRS PrestoSQL</strong>.</p>
</td>
</tr>
<tr id="mrs_01_0635__row387935191413"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.2.1.2.3.1.1 "><p id="mrs_01_0635__p1187965151415">Data Connection Name</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.2.1.2.3.1.2 "><p id="mrs_01_0635__p1687995101419">Name of the data connection to be created, which contains 1 to 100 characters and consists of only letters, digits, underscores (_), and hyphens (-).</p>
</td>
</tr>
<tr id="mrs_01_0635__row1987914510149"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.2.1.2.3.1.1 "><p id="mrs_01_0635__p187918519147">Cluster Name</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.2.1.2.3.1.2 "><p id="mrs_01_0635__p18793551410">Name of the MRS cluster to which Presto belongs.</p>
</td>
</tr>
</tbody>
</table>
</div>
</p></li><li id="mrs_01_0635__li16832892012"><span>Click <strong id="mrs_01_0635__en-us_topic_0141836082_b17516194608">Test</strong> to test connectivity of the data connection to be created. If the test passes, the data connection is created.</span></li><li id="mrs_01_0635__li1686817312117"><span>Click <strong id="mrs_01_0635__b797387892625">OK</strong>.</span></li></ol>
</div>
<div class="section" id="mrs_01_0635__section5530207102217"><h4 class="sectiontitle">Creating and Executing SQL Scripts on the DLF Script Development Page</h4><div class="caution" id="mrs_01_0635__note1677803018259"><span class="cautiontitle"><img src="public_sys-resources/caution_3.0-en-us.png"> </span><div class="cautionbody"><p id="mrs_01_0635__p1168625011257">In this scenario, the query results dumped to OBS can be retained for a maximum of 10,000 times. If the number of query times exceeds 10,000, the historical query results are automatically aged based on the query time sequence. To prevent data loss, exercise caution when performing this operation.</p>
</div></div>
<ol id="mrs_01_0635__ol104011733102213"><li id="mrs_01_0635__li72071044182210"><span>In the left navigation pane of the <span id="mrs_01_0635__text186026091792625">DLF</span> console, choose <span class="menucascade" id="mrs_01_0635__menucascade171199428692625"><b><span class="uicontrol" id="mrs_01_0635__uicontrol77521333392625"><span id="mrs_01_0635__text162664132992625">Development</span></span></b> &gt; <b><span class="uicontrol" id="mrs_01_0635__uicontrol7236490292625"><span id="mrs_01_0635__text90217312792625">Develop Script</span></span></b></span>.</span></li><li id="mrs_01_0635__li715913663419"><span>In the right pane, click <strong id="mrs_01_0635__b87050348992625">Create SQL Script</strong> and select <strong id="mrs_01_0635__b160581340592625">Presto</strong>.</span></li><li id="mrs_01_0635__li7539305434"><span>In the upper right part of the editor, select the connection created in <a href="#mrs_01_0635__section2028018713307">Creating a Data Connection of the MRS PrestoSQL Type in DLF</a> from the <strong id="mrs_01_0635__b124263937892625">Connection</strong> drop-down list.</span></li><li id="mrs_01_0635__li589410994614"><span>In the upper right part of the editor, select the schema from the <strong id="mrs_01_0635__b47557296892625">Schema</strong> drop-down list box.</span></li><li id="mrs_01_0635__li1239225664615"><span>Enter one or more SQL statements in the editor. If you need to run a specified SQL statement separately, select the SQL statement before running it.</span></li><li id="mrs_01_0635__li68735634910"><span>In the upper part of the editor, click <span class="uicontrol" id="mrs_01_0635__uicontrol176275343492625"><b>Execute</b></span>. After executing the SQL statement, view the execution history and result of the script in the lower part of the editor.</span><p><div class="note" id="mrs_01_0635__note2016713392494"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="mrs_01_0635__ul18453153514502"><li id="mrs_01_0635__li114537358501">Administrator operations are not supported. That is, all commands that can be executed only after the <strong id="mrs_01_0635__b157784968392625">set role admin</strong> command is executed are not supported.</li><li id="mrs_01_0635__li184900145228">Each statement is executed independently. Therefore, the statement with context settings (for example, <strong id="mrs_01_0635__b102091227192625">use</strong>) does not take effect after being executed.</li><li id="mrs_01_0635__li10628537205016">When Presto authorization is enabled, the default permissions of various users are as follows:<ul id="mrs_01_0635__ul5694554144912"><li id="mrs_01_0635__li069415424913">All users have the read/write permissions on the <strong id="mrs_01_0635__b168775841392625">mrs_reserved</strong> database in Hive by default.</li><li id="mrs_01_0635__li1969410549490">All IAM users with the MRS CommonOperations, MRS FullAccess, MRS Administrator, and Tenant Administrator policies have read/write permission on the <strong id="mrs_01_0635__b165809830692625">default</strong> database in Hive, and users with the MRS ReadOnlyAccess policy have read-only permission on the database.</li><li id="mrs_01_0635__li6694135414499">User <strong id="mrs_01_0635__b211078132392625">admin</strong> of the cluster and IAM users with the MRS FullAccess, MRS Administrator, and Tenant Administrator policies have the <strong id="mrs_01_0635__b47256947192625">admin</strong> role permission on the Hive database.</li></ul>
</li></ul>
</div></div>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_0432.html">Using Presto</a></div>
</div>
</div>