The Beeswax application enables you to perform queries on Apache Hive, a data warehousing system designed to work with Hadoop. For information about Hive, see Hive Documentation. You can create, run, and manage queries, and download the results in a Microsoft Office Excel worksheet file or a comma-separated values file.
Beeswax is installed and configured as part of Hue. For information about installing and configuring Hue, see Hue Installation.
Beeswax assumes an existing Hive installation. The Hue installation instructions include the configuration necessary for Beeswax to access Hive. You can view the current Hive configuration from from the Settings tab in the Beeswax application.
By default, a Beeswax user can see the saved queries for all users – both his/her own queries and those of other Beeswax users. To restrict viewing saved queries to the query owner and Hue administrators, set the share_saved_queries property under the [beeswax] section in the Hue configuration file to false.
To start the Beeswax application, click the Beeswax icon () in the navigation bar at the top of the Hue browser page.
The Query Editor view lets you create queries in the Hive Query Language (HQL), which is similar to Structured Query Language (SQL). You can name and save your queries to use later. When you submit a query, the Beeswax Server uses Hive to run the queries. You can either wait for the query to complete, or return later to find the queries in the History view. You can also request receive an email message after the query is completed.
![]() | Note To run a query, you must be logged in to Hue as a user that also has a Unix user account on the remote server. |
To create and run a query:
SELECT * FROM sample_08
![]() |
|
The pane to the left of the Query Editor lets you specify the following options:
Option | Description | ||
---|---|---|---|
DATABASE | The database containing the table definitions. | ||
SETTINGS | Override the Hive and Hadoop default settings. Click Add to configure a new setting. » For Key, enter a Hive or Hadoop configuration variable name. » For Value, enter the value you want to use for the variable. For example, to override the directory where structured Hive query logs are created, you would enter hive.querylog.location for Key, and a path for Value. To view the default settings, click the Settings tab at the top of the page. For information about Hive configuration variables, see: http://wiki.apache.org/hadoop/Hive/AdminManual/Configuration. For information about Hadoop configuration variables, see: http://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/mapred-default.xml |
||
FILE RESOURCES | Make locally accessible files available at query execution time on the entire Hadoop cluster. Hive uses Hadoop's Distributed Cache to distribute the added files to all machines in the cluster at query execution time. Click Add to configure a new setting. From the Type drop-down menu, choose one of the following: jar — Adds the resources to the Java classpath. This is required in order to reference objects such as user defined functions. archive — Automatically unarchives resources when distributing them. file — Adds resources to the distributed cache. Typically, this might be a transform script (or similar) to be executed. For Path, enter the path to the file or click Choose a File to browse and select the file.
|
||
USER-DEFINED FUNCTIONS | Specify user-defined functions in a query. Specify the function name for Name, and specify the class name for Class name. Click Add to configure a new setting. You must specify a JAR file for the user-defined functions in File Resources. To include a user-defined function in a query, add a $ (dollar sign) before the function name in the query. For example, if MyTable is a user-defined function name in the query, you would type: SELECT * $MyTable |
||
PARAMETERIZATION | Indicate that a dialog box should display to enter parameter values when a query containing the string $<parametername> is executed. Enabled by default. | ||
EMAIL NOTIFICATION | Indicate that an email message should be sent after a query completes. The email is sent to the email address specified in the logged-in user's profile. |
Beeswax enables you to view the history of queries that you have previously run. Results for these queries are available for one week or until Hue is restarted.
To view query history:
You can view a list of saved queries of all users by clicking Saved Queries in the Beeswax window. You can copy any user's query, but you can only edit, delete, and view the history of your own queries.
To edit a saved query:
To delete a saved query:
To copy a saved query:
To copy a query in the Beeswax Query History window: