Manipulating Hive in Hue

Source: Internet
Author: User
Create a new table

The table statement is as follows:

CREATE TABLE IF not EXISTS user_collection_9 (  
user_id string,  
seller_id string,  
product_id string, 
Tim E string
)  
Import data to hive in Hue

First, in the file browser, the text that you created the table is directed in, as shown in the following illustration:

Use the following action statement to import text data into hive.
Hive The selected table data into a new table

Since my three table structure is the same, the following action statement is used directly.

CREATE TABLE User_port as SELECT * from user_collection_7 UNION ALL SELECT * to user_collection_8 UNION ALL SELECT * FRO M User_collection_9
connection functions in hive

In hive, Group_concat cannot be used and CONCAT_WS is used.

CREATE table user_collection_port as select IP as User_id,concat_ws (', Collect_set (product_id)) as product from User_coll Ection_taobao_allall GROUP by IP has count (*) >2;

The result of using this function is to connect each user's data together, separated by spaces in the middle, as shown in the following illustration:
hue the data in hive to local

The following table structure is the same as the previous image, so the two columns are directly delimited using tabs, and you will find that in the "/user/qianyang/" directory, there are

Insert overwrite  directory '/user/qianyang/' row format delimited fields terminated by ' \ t ' select * from User_789coll ection;

You can browse some of this data online.
Export to Windows

The table data can be downloaded to the local area as shown in the following illustration.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.