Hwi is short for hive web interface and is a Web replacement solution of hive CLI.
For details about how to build a hive platform, refer to: Building a hive Platform
However, this function is currently relatively simple.ArticleLet's take a look at how to use Hwi in hive-0.4.1 for operations.
Enable Hwi
Suppose hive is deployed on the 10.20.151.7 machine, CONF/hive-default.xml files are all default values, then we enter: http: // 10.20.151.7: 9999/Hwi/in the browser to access it.
Access schema information (Browse schema)
On the web page, click browsers schema or enter http: // 10.20.151.7: 9999/Hwi/show_databases.jsp to view the schema:
The interface displays information about the currently available databases, including only one database (default). Click default to view information about all tables in the default database.
We can see that there are three tables. Click the table name to see more detailed table structure information. For example, click pokes:
This is the schema information browsing function, used to replace the show tables function in CLI.
View system diagnostic information (diagnostics)
Click diagnostics to view the diagnostic information of the system, for example:
Authorize, create session, and list sessions)
Before explaining these functions, we need to first understand the relationship between user authentication and sessions.
For user authentication in Hwi, you need to enter the user name and user group, for example:
Each user authentication information corresponds to a set of sessions ). After hive is restarted, session information will be lost.
Before creating a hive query, we need to create a session and click Create session.
Click list sessions to view the corresponding session Group on the user authentication (Authorize.
Execute Query
In most cases, we do not need to set the user authentication information. Suppose we have not set the user authentication information, and then create a session to S1
Click list sessions and you will see the following interface:
Click manager to go to the query page:
You can directly enter the query statement in the query, execute the output file name in the result, and set start query to yes, for example:
Note that the query statement here is a little different from CLI, and there is no semicolon (;) at the end of the query statement (;).
After clicking "Submit query content", we can see the following interface:
At this time, we can click View File to view the results:
In this way, the query is completed.
At the same time, we can find the s1_result file under the directory of the hive installation directory.
Comparison between Hwi and CLI
If you have read the above introduction, you will find a very serious problem: the execution process is not prompted. We don't know when the execution of a query will end.
Summarize the advantages and disadvantages of comparing Hwi with CLI:
Advantage: Hwi supports browser browsing, which is convenient and intuitive.
Disadvantage: no execution prompt.
I personally prefer to use CLI :)