Using the Metadata Browser on the Hue Web UI
Scenario
Users can use the Hue web UI to manage Hive metadata in an MRS cluster.
Using Metastore Manager
Access the Hue web UI. For details, see Accessing the Hue Web UI.
Choose Data Browsers > Metastore Tables, and access Metastore Manager.
- Viewing metadata of Hive tables
In the left navigation pane, move the cursor to a table and click on the right. The metadata of the Hive table is displayed.
- Managing metadata of Hive tables
On the metadata page of a Hive table, you can click in the upper right corner to import data, click to browse data, and click to view the location of the table file.
The Hue page is used to view and analyze data such as files and tables. Do not perform high-risk management operations such as deleting objects on the page. If an operation is required, you are advised to perform the operation on each component after confirming that the operation has no impact on services. For example, you can use the HDFS client to perform operations on HDFS files and use the Hive client to perform operations on Hive tables.
- Managing Hive metadata tables
Click in the upper right corner to create a table in the database based on the uploaded files. Or click in the upper right corner to manually create a table.
Accessing Metastore Manager
- Access the Hue web UI. For details, see Accessing the Hue Web UI.
- Choose Data Browsers > Metastore Tables, and access Metastore Manager.
Metastore Manager supports the following functions:
- Creating a Hive table from a file
- Manually creating a Hive table
- Viewing Hive table metadata
Creating a Hive table from a File
- Access Metastore Manager and select a database in Databases.
The default database is default.
- Click . The Create a new table from a file page is displayed.
- Select a file.
- In Table Name, enter a Hive table name.
A Hive table name contains no more than 128 characters, including letters, numbers, or underscores (_), and must start with a letter or number.
- In Description, enter description about the Hive table as required.
- In Input File or Location, click and select a Hive table file from HDFS. The file is used to store new data of the Hive table.
If the file is not stored in HDFS, click Upload a file to upload the file from the local directory to HDFS. Multiple files can be simultaneously uploaded. The files cannot be empty.
- If you need to import the data in the file to the Hive table, select Import data as Load method. By default, Import data is selected.
If you select Create External Table, a Hive external table is created.
If you select Create External Table, set Input File or Location to a path.
If you select Leave Empty, an empty Hive table is created.
- Click Next.
- In Table Name, enter a Hive table name.
- Set a delimiter.
- In Delimiter, select one.
If your desired delimiter is not in the list, select Other.. and enter a delimiter.
- Click Preview to preview data processing.
- Click Next.
- In Delimiter, select one.
- Define a column.
- If you click on the right side of Use first row as column names, the first row of data in the file is used as a column name. If you do not click it, the first row of data is not used as the column name.
- In Column name, set a name for each column.
A Hive table name contains no more than 128 characters, including letters, numbers, or underscores (_), and must start with a letter or number.
You can rename columns in batches by clicking on the right side of Bulk edit column names. Enter all column names and separate them by commas (,).
- In Column Type, select a type for each column.
- Click Create Table to create the table. Wait for Hue to display information about the Hive table.
Manually Creating a Hive Table
- Access Metastore Manager and select a database in Databases.
The default database is default.
- Click . The Create a new table manually page is displayed.
- Set a table name.
- In Table Name, enter a Hive table name.
A Hive table name contains no more than 128 characters, including letters, numbers, or underscores (_), and must start with a letter or number.
- In Description, enter description about the Hive table as required.
- Click Next.
- In Table Name, enter a Hive table name.
- Select a data storage format.
- Set a delimiter.
- In Field terminator, set a column delimiter.
If your desired delimiter is not in the list, select Other.. and enter a delimiter.
- In Collection terminator, set a delimiter to separate the data set of columns of the array type in Hive. For example, the type of a column is array. A value needs to store employee and manager. The user specifies a colon (:) as the delimiter. Therefore, the final value is employee:manager.
- In Map key terminator, set a delimiter to separate the data set of columns of the map type in Hive. For example, the type of a column is map. A value needs to store home of aaa and company of bbb. The user defines | as the delimiter. Therefore, the final value is home|aaa:company|bbb.
- Click Next and perform 7.
- In Field terminator, set a column delimiter.
- Set serialization properties.
- In SerDe Name, enter the class name of the serialization format: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
Users can expand Hive to support more customized serialization classes.
- In Serde properties, enter the value of the serialization format: "field.delim"="," "colelction.delim"=":" "mapkey.delim"="|"
- Click Next and perform 7.
- In SerDe Name, enter the class name of the serialization format: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
- Select a data table format and click Next.
- TextFile: indicates that data is stored in text files.
- SequenceFile: indicates that data is stored in binary files.
- InputFormat: indicates that data in files is used in the customized input and output formats.
Users can expand Hive to support more customized formatting classes.
- In InputFormat Class, enter the class used by input data: org.apache.hadoop.hive.ql.io.RCFileInputFormat
- In OutputFormat Class, enter the class used by output data: org.apache.hadoop.hive.ql.io.RCFileOutputFormat
- Select a file storage location and click Next.
Use default location is selected by default. If you want to customize a storage location, deselect the default value and specify a file storage location in External location by clicking .
- Set columns of the Hive table.
- In Column name, set a column name.
A Hive table name contains no more than 128 characters, including letters, numbers, or underscores (_), and must start with a letter or number.
- In Column type, select a type for each column.
Click Add a column to add a new column.
- Click Add a partition to add a new partition for the Hive table to improve the query efficiency.
- In Column name, set a column name.
- Click Create Table to create a new table. Wait for Hue to display information about the Hive table.
Managing the Hive Table
- Access Metastore Manager and select a database in Databases. All tables in the database are displayed on the page.
The default database is default.
- Click a table name in the database to view table details.
The following operations are supported: importing data, browsing data,, or viewing file storage location. When viewing all tables in the database, you can select tables and perform the following operations such as viewing tables and browsing data.
The Hue page is used to view and analyze data such as files and tables. Do not perform high-risk management operations such as deleting objects on the page. If an operation is required, you are advised to perform the operation on each component after confirming that the operation has no impact on services. For example, you can use the HDFS client to perform operations on HDFS files and use the Hive client to perform operations on Hive tables.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot