Hue is an interface for interacting with web applications that access the MapR File System (MapR-FS). Use the applications in Hue to access MapR-FS, work with tables, run Hive queries, MapReduce jobs, and Oozie workflows.
The MapR Sandbox for Hadoop includes brief overviews and tutorials for the following Hue applications:
- File Browser
- Metastore Manager
- Job Designer
The tutorials are designed to help get you acquainted with HUE and MapR-FS. Use the tutorials to perform the following operations:
- Upload files with File Browser2
- Convert a file into a table with Metastore Manager
- Run a simple Hive query on a table with Beeswax
- Create and run a word count MapReduce job with Pig
- Create and submit a MapReduce job design with Job Designer
- Create and run a workflow with Oozie
Before You Begin
Download the following files for use in the tutorials:
Login to Hue
Using File Browser
File Browser is an application that you can use to access files and directories in the MapR File System (MapR-FS). Use File Browser in HUE to perform the following directory tasks:
- Create directories
- Upload, rename, transfer, and delete files and directories
- Change the owner, group, and permissions of a file or directory
- View and edit files as text or binary or download the files to your local system
- View MapReduce job input and output files
In this tutorial, create a new directory, and upload the customers.csv file.
Create a new directory:
- Click .The File Browser - page opens.
- Select oozie to open the directory.
- Click the New button, and select Directory.
- Enter CustomerDirectory as the directory name.
- Click Submit. The CustomerDirectory appears in the list.
Upload a file:
- Open the CustomerDirectory.
- Click the Upload button, and select Files.
- Click Select Files in the pop up dialog.
- Navigate to the customers.csv file and upload the file. The file appears in the CustomerDirectory.
Next: Use Metastore Manager to create a table from the customers.csv file that you just uploaded.
Using Metastore Manager
Metastore Manager is an application that you can use to manage databases, tables, and partitions stored in a relational database that applications, like HIVE, access through the metastore service API.
Use Metastore Manager to perform the following table operations:
- Create tables
- Browse tables
- Import table data
- Drop tables
- View table location
Use Metastore Manager to perform the following database operations:
- Select a database
- Create a database
- Drop a database
In this tutorial, import the customer.csv file, and create a table from the file.
Import the customer.csv file:
- Click . The Metastore Manager page opens.
- Under Actions, select Create a new table from a file.
- Enter customer_table as the table name and description.
- In the Input file field, browse to the CustomerDirectory, and upload the customer.csv file
Choose a delimiter:
- Select Comma as the delimiter.
- Click Next.
Define your columns:
- Enter column names. Enter State as the column name for col_6.
- Select column types that correlate with the data.
- Click Create table. A message, “Waiting for query” appears while the system creates the table.
- After the table is created, click on the Sample view to see the new table.
Next: Use Beeswax to run a Hive query on the table.
Beeswax is an application for querying data in Hive. Hive is a data warehouse system for Hadoop that uses an SQL-like language to query structured data in the MapR File System (MapR-FS). You can access Beeswax from the HUE interface to run Hive queries with Hive's Query Language (HQL) and then save the queries.
In this tutorial, use Beeswax to run a basic Hive query against the customer_table you created.
Create and run a query:
- Click . The Hive Query page opens.
- In the Query Editor, enter the following query:
SELECT * FROM customer_table WHERE state=”TX”
- Click Execute.
The system processes the query and then displays all the customers located in Texas in the Results view.
- Optionally, save the query or download the query as a CSV or XLS file.