Data storage for the hive of Hadoop notes (bucket table)

Source: Internet
Author: User

<title>Data storage for hive (bucket table)</title> Data storage (bucket table) bucket table for hive
    • A bucket table is a hash of the data, which is then stored in a different file.


For example, to create three buckets, the principle of creating a bucket is to create a bucket according to the name of the middle school student in the left table. In this way, the left side of the data in the bucket can be used to hash the student name, the same hash value of the column stored in the same bucket. For example, Tom, Jerry, and Scott after the operation their hash value is the same, then the three people's information will be stored in the same bucket.
With the bucket table, you can reduce the file block of the system, thus improving the query speed

0 How do I create a bucket table? (Create 5 buckets with a name)

create table bucket_table1
(sid int,sname string,age int)
clustered by(sname) into 5 buckets;

Look at the structure of the table

desc bucket_table1;
sid int
sname string
age int

It's the same as the normal table, but the same hash value is put in the same bucket when the data is put in.

This is the bucket table.

Data storage for the hive of Hadoop notes (bucket table)

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.