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>
41 lines
12 KiB
HTML
41 lines
12 KiB
HTML
<a name="mrs_01_0371"></a><a name="mrs_01_0371"></a>
|
|
|
|
<h1 class="topictitle1">Using HiveQL Editor on the Hue Web UI</h1>
|
|
<div id="body1589421627360"><div class="section" id="mrs_01_0371__s9f93d0a70cdc4575b48c96902a562dfe"><h4 class="sectiontitle">Scenario</h4><p id="mrs_01_0371__p28208574198">Users can use the Hue web UI to execute HiveQL statements in a cluster.</p>
|
|
<p id="mrs_01_0371__p18497646204210">For versions earlier than MRS 1.9.2, MRS clusters with Kerberos authentication enabled support this function.</p>
|
|
</div>
|
|
<div class="section" id="mrs_01_0371__section26788191145057"><h4 class="sectiontitle">Accessing Query Editors</h4><ol id="mrs_01_0371__ol44107557145123"><li id="mrs_01_0371__li849515575276"><span>Access the Hue web UI. For details, see <a href="mrs_01_0370.html">Accessing the Hue Web UI</a>.</span></li><li id="mrs_01_0371__li32181645145123"><span>Choose <span class="menucascade" id="mrs_01_0371__menucascade60776632145123"><b><span class="uicontrol" id="mrs_01_0371__uicontrol59574147145123">Query Editors</span></b> > <b><span class="uicontrol" id="mrs_01_0371__uicontrol66405282145123">Hive</span></b></span>. The <span class="wintitle" id="mrs_01_0371__wintitle888746185010"><b>Hive</b></span> page is displayed.</span><p><p id="mrs_01_0371__p18668164145123"><span class="uicontrol" id="mrs_01_0371__uicontrol695715155014"><b>Hive</b></span> supports the following functions:</p>
|
|
<ul id="mrs_01_0371__ul25945359145123"><li id="mrs_01_0371__li8151932145123">Executes and manages HiveQL statements.</li><li id="mrs_01_0371__li58461858145123">View the HiveQL statements saved by the current user in <span class="uicontrol" id="mrs_01_0371__uicontrol6918175235215"><b>Saved Queries</b></span>.</li><li id="mrs_01_0371__li40165519145123">Query HiveQL statements executed by the current user in <span class="uicontrol" id="mrs_01_0371__uicontrol2600182018533"><b>Query History</b></span>.</li><li id="mrs_01_0371__li64553163145123">Click <span><img id="mrs_01_0371__image87893025517" src="en-us_image_0000001349289717.jpg"></span> to display all databases included in <span class="uicontrol" id="mrs_01_0371__uicontrol143345315556"><b>Databases</b></span> of Hive.</li></ul>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="mrs_01_0371__section5938223214523"><h4 class="sectiontitle">Executing HiveQL Statements</h4><ol id="mrs_01_0371__ol59674238145244"><li id="mrs_01_0371__li36882002145244"><span>Choose <span class="menucascade" id="mrs_01_0371__menucascade202714655118"><b><span class="uicontrol" id="mrs_01_0371__uicontrol12715618517">Query Editors > Hive</span></b></span>. The <span class="wintitle" id="mrs_01_0371__wintitle439417128510"><b>Hive</b></span> page is displayed.</span></li><li id="mrs_01_0371__li55366463145244"><span>Click <span><img id="mrs_01_0371__image58062214596" src="en-us_image_0000001296090388.jpg"></span> and select a database from <span class="uicontrol" id="mrs_01_0371__uicontrol1427017463578"><b>Databases</b></span>. The default database is <span class="parmvalue" id="mrs_01_0371__parmvalue34652220145244"><b>default</b></span>.</span><p><p id="mrs_01_0371__p43434531145244">The system displays all available tables in the database. You can enter a keyword of the table name to search for the desired table.</p>
|
|
</p></li><li id="mrs_01_0371__li29724435145244"><span>Click the desired table name. All columns in the table are displayed.</span><p><p id="mrs_01_0371__p55498498145244">Move the cursor to the row of the table and click <span><img id="mrs_01_0371__image64015734710" src="en-us_image_0000001295930560.jpg"></span>. Column details are displayed. </p>
|
|
</p></li><li id="mrs_01_0371__li62672328145244"><span>Enter the query statements in the area for editing HiveQL statements.</span><p><p id="mrs_01_0371__p51702834145244">Click <span><img id="mrs_01_0371__image1461310445470" src="en-us_image_0000001295930564.jpg"></span> and select <span class="uicontrol" id="mrs_01_0371__uicontrol17682071808"><b>Explain</b></span>. The editor checks the syntax and execution plan of the entered statements. If the statements have syntax errors, the editor reports <span class="parmvalue" id="mrs_01_0371__parmvalue28114380145244"><b>Error while compiling statement</b></span>.</p>
|
|
</p></li><li id="mrs_01_0371__li3950929145244"><span>Click <span><img id="mrs_01_0371__image18459851421" src="en-us_image_0000001348770417.png"></span> and select the engine for executing the HiveQL statements.</span><p><ul id="mrs_01_0371__ul45178234145244"><li id="mrs_01_0371__li20044420145244"><span class="parmvalue" id="mrs_01_0371__parmvalue17140238145244"><b>mr</b></span>: MapReduce computing framework</li><li id="mrs_01_0371__li49759046145244"><span class="parmvalue" id="mrs_01_0371__parmvalue12985323145244"><b>spark</b></span>: Spark computing framework</li><li id="mrs_01_0371__li64128224139"><span class="parmvalue" id="mrs_01_0371__parmvalue041572210131"><b>tez</b></span>: Tez computing framework<div class="note" id="mrs_01_0371__note19474938131314"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="mrs_01_0371__p94913387133">Tez is applicable to MRS 1.9.<em id="mrs_01_0371__i4920164023114">x</em> and later versions.</p>
|
|
</div></div>
|
|
</li></ul>
|
|
</p></li><li id="mrs_01_0371__li66282794145244"><span>Click <span><img id="mrs_01_0371__image152120534504" src="en-us_image_0000001349289713.jpg"></span> to execute the HiveQL statements.</span><p><div class="note" id="mrs_01_0371__note52103997145244"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="mrs_01_0371__ul35615494145244"><li id="mrs_01_0371__li6209567145244">If you want to use the entered HiveQL statements again, click <span><img id="mrs_01_0371__image1945715562513" src="en-us_image_0000001349170129.jpg"></span> to save them.</li><li id="mrs_01_0371__li61972459145244">To format HiveQL statements, click <span><img id="mrs_01_0371__image13777122614524" src="en-us_image_0000001295930564.jpg"></span> and select <span class="uicontrol" id="mrs_01_0371__uicontrol976816241463"><b>Format</b></span>.</li><li id="mrs_01_0371__li34295104145244">To delete an entered HiveQL statement, click <span><img id="mrs_01_0371__image762853195215" src="en-us_image_0000001295930564.jpg"></span> and select <span class="wintitle" id="mrs_01_0371__wintitle74641167712"><b>Clear</b></span>.</li><li id="mrs_01_0371__li63843701145244">Clear the entered statement and execute a new statement. Click <span><img id="mrs_01_0371__image18685182025316" src="en-us_image_0000001295930564.jpg"></span> and select <span class="uicontrol" id="mrs_01_0371__uicontrol53489153814"><b>New query</b></span>.</li><li id="mrs_01_0371__li1580691217484">Viewing history:<p id="mrs_01_0371__p16806151215484"><a name="mrs_01_0371__li1580691217484"></a><a name="li1580691217484"></a>Click <span class="uicontrol" id="mrs_01_0371__uicontrol1766415111917"><b>Query History</b></span> to view the HiveQL running status. You can view the history of all the statements or only the saved statements. If many historical records exist, you can enter keywords in the text box to search for desired records.</p>
|
|
</li><li id="mrs_01_0371__li674754114817">Advanced query configuration:<p id="mrs_01_0371__p574717411482"><a name="mrs_01_0371__li674754114817"></a><a name="li674754114817"></a>Click <span><img id="mrs_01_0371__image4747241154816" src="en-us_image_0000001349289709.png"></span> in the upper right corner to configure information such as files, functions, and settings.</p>
|
|
</li><li id="mrs_01_0371__li1174704114814">Viewing the information of shortcut keys:<p id="mrs_01_0371__p374717418489"><a name="mrs_01_0371__li1174704114814"></a><a name="li1174704114814"></a>Click <span><img id="mrs_01_0371__image57471441144817" src="en-us_image_0000001349090229.png"></span> in the upper right corner to view all shortcut keys.</p>
|
|
</li></ul>
|
|
</div></div>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="mrs_01_0371__section3491749914539"><h4 class="sectiontitle">Viewing Execution Results</h4><ol id="mrs_01_0371__ol47679345145312"><li id="mrs_01_0371__li13016201145312"><span>In the <span class="wintitle" id="mrs_01_0371__wintitle4129142195112"><b>Hive</b></span> execution area, <span class="uicontrol" id="mrs_01_0371__uicontrol15565171717912"><b>Query History</b></span> is displayed by default.</span></li><li id="mrs_01_0371__li50036947145312"><span>Click <span class="uicontrol" id="mrs_01_0371__uicontrol37863318120"><b>Results</b></span> to view the execution result of the executed statement.</span></li></ol>
|
|
</div>
|
|
<div class="section" id="mrs_01_0371__section53760602145325"><h4 class="sectiontitle">Managing Query Statements</h4><ol id="mrs_01_0371__ol61171655145335"><li id="mrs_01_0371__li31679683145335"><span>Choose <span class="uicontrol" id="mrs_01_0371__uicontrol46787358145335"><b>Query Editors > Hive</b></span>. The <span class="wintitle" id="mrs_01_0371__wintitle144461633165119"><b>Hive</b></span> page is displayed.</span></li><li id="mrs_01_0371__li14253391145335"><span>Click <span class="uicontrol" id="mrs_01_0371__uicontrol842826141519"><b>Saved Queries</b></span>.</span><p><p id="mrs_01_0371__p17656764145338">Click a saved statement. The system automatically adds the statement to the editing area.</p>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="mrs_01_0371__section62596142145356"><h4 class="sectiontitle">Modifying Query Editors Settings</h4><ol id="mrs_01_0371__ol5177964214543"><li id="mrs_01_0371__li1502120814543"><span>On the <span class="wintitle" id="mrs_01_0371__wintitle678217389514"><b>Hive</b></span> tab page, click <span><img id="mrs_01_0371__image1931015286554" src="en-us_image_0000001349170133.jpg"></span>.</span></li><li id="mrs_01_0371__li2308899414543"><span>Click <span><img id="mrs_01_0371__image860765510554" src="en-us_image_0000001348770421.jpg"></span> on the right of <span class="filepath" id="mrs_01_0371__filepath5604123921611"><b>Files</b></span> and click <span><img id="mrs_01_0371__image44615161571" src="en-us_image_0000001349170125.jpg"></span> to specify the directory for storing the file.</span><p><p id="mrs_01_0371__p2493506514543">You can click <span><img id="mrs_01_0371__image68051841125715" src="en-us_image_0000001348770421.jpg"></span> to add a file resource.</p>
|
|
</p></li><li id="mrs_01_0371__li6062811414543"><span>Click <span><img id="mrs_01_0371__image2056171385812" src="en-us_image_0000001348770421.jpg"></span> on the right of <span class="uicontrol" id="mrs_01_0371__uicontrol206879153173"><b>Functions</b></span> and enter the names of user-defined function and function class.</span><p><p class="litext" id="mrs_01_0371__p6638878014543">You can click <span><img id="mrs_01_0371__image9504139185810" src="en-us_image_0000001348770421.jpg"></span> to add a customized function.</p>
|
|
</p></li><li id="mrs_01_0371__li6540561714543"><span>Click <span><img id="mrs_01_0371__image22716685912" src="en-us_image_0000001348770421.jpg"></span> on the right of <span class="uicontrol" id="mrs_01_0371__uicontrol469933612176"><b>Settings</b></span>, enter the Hive parameter name in the <span class="uicontrol" id="mrs_01_0371__uicontrol47081547185"><b>Key</b></span>, and value in <span class="uicontrol" id="mrs_01_0371__uicontrol4944182311818"><b>Value</b></span>. The current Hive session connects to Hive based on the customized configuration.</span><p><p id="mrs_01_0371__p726729014543">You can click <span><img id="mrs_01_0371__image13973133465917" src="en-us_image_0000001348770421.jpg"></span> to add a parameter.</p>
|
|
</p></li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_0369.html">Using Hue (Versions Earlier Than MRS 3.x)</a></div>
|
|
</div>
|
|
</div>
|
|
|