Metastore Manager
The Metastore Manager application enables you to manage the databases,
tables, and partitions of the
Hive metastore shared by
the (Beeswax and Cloudera Impala Query
UI) applications. You can use Metastore
Manager to perform the following operations:
Metastore Manager Installation and Configuration
Metastore Manager is one of the applications installed as part of Hue.
For information about installing and configuring Hue, see the Hue Installation
manual.
Starting Metastore Manager
Click the Metastore Manager icon
(
) in the navigation bar at
the top of the Hue browser page.
Installing Sample Tables
Note: You must be a superuser to perform
this task.
- Click
. The Quick Start Wizard
opens.
- Click Step 2: Examples.
- Click Beeswax (Hive UI) or Cloudera Impala Query UI.
Importing Data
If you want to import your own data instead of installing the sample
tables, follow the procedure in Creating Tables.
Selecting a Database
- In the pane on the left, select the database from the DATABASE
drop-down list.
Creating a Database
- Click
.
-
- Specify a database name and optional description. Database names
are not case-sensitive. Click Next.
- Do one of the following:
- Keep the default location in the Hive warehouse folder.
- Specify an external location within HDFS:
- Uncheck the Location checkbox.
- In the External location field, type a path to a folder
on HDFS or click
to browse
to a folder and click Select this folder.
Click Create a new database.
- Click the Create Database button.
Dropping Databases
- Click
.
- In the list of databases, check the checkbox next to one or more
databases.
- Click the
Drop button.
- Confirm whether you want to delete the databases.
Creating Tables
Although you can create tables by executing the appropriate Hive HQL DDL
query commands, it is easier to create a table using the Metastore
Manager table creation wizard.
There are two ways to create a table: from a file or manually. If you
create a table from a file, the format of the data in the file will
determine some of the properties of the table, such as the record and
file formats. The data from the file you specify is imported
automatically upon table creation. When you create a file manually, you
specify all the properties of the table, and then execute the resulting
query to actually create the table. You then import data into the table
as an additional step.
From a File
- In the ACTIONS pane in the Metastore Manager window, click Create
a new table from a file. The table creation wizard starts.
- Follow the instructions in the wizard to create the table. The basic
steps are:
- Choose your input file. The input file you specify must exist.
Note that you can choose to have Beeswax create the table
definition only based on the import file you select, without
actually importing data from that file.
- Specify the column delimiter.
- Define your columns, providing a name and selecting the type.
-
Click Create Table to create the table. The new table's metadata
displays on the right side of the Table Metadata window. At this
point, you can view the metadata or a sample of the data in the
table. From the ACTIONS pane you can import new data into the table,
browse the table, drop it, or go to the File Browser to see the
location of the data.
Manually
- In the ACTIONS pane in the Metastore Manager window, click Create
a new table manually. The table creation wizard starts.
- Follow the instructions in the wizard to create the table. The basic
steps are:
- Name the table.
- Choose the record format.
- Configure record serialization by specifying delimiters for
columns, collections, and map keys.
- Choose the file format.
- Specify the location for your table's data.
- Specify the columns, providing a name and selecting the type for
each column.
- Specify partition columns, providing a name and selecting the
type for each column.
-
Click Create table. The Table Metadata window displays.
Browsing Tables
To browse table data:
In the Table List window, check the checkbox next to a table name and
click Browse Data. The table's data displays in the Query Results
window.
To browse table metadata:
Do one of the following:
Importing Data into a Table
When importing data, you can choose to append or overwrite the table's
data with data from a file.
- In the Table List window, click the table name. The Table Metadata
window displays.
- In the ACTIONS pane, click Import Data.
- For Path, enter the path to the file that contains the data you
want to import.
- Check Overwrite existing data to replace the data in the
selected table with the imported data. Leave unchecked to append to
the table.
- Click Submit.
Dropping Tables
- In the Table List window, click the table name. The Table Metadata
window displays.
- In the ACTIONS pane, click Drop Table.
- Click Yes to confirm the deletion.
Viewing a Table's Location
- In the Table List window, click the table name. The Table Metadata
window displays.
- Click View File Location. The file location of the selected
table displays in its directory in the File Browser window.