Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Apache Hive Essentials. - Second Edition

You're reading from  Apache Hive Essentials. - Second Edition

Product type Book
Published in Jun 2018
Publisher Packt
ISBN-13 9781788995092
Pages 210 pages
Edition 2nd Edition
Languages
Author (1):
Dayong Du Dayong Du
Profile icon Dayong Du

Table of Contents (12) Chapters

Preface Overview of Big Data and Hive Setting Up the Hive Environment Data Definition and Description Data Correlation and Scope Data Manipulation Data Aggregation and Sampling Performance Considerations Extensibility Considerations Security Considerations Working with Other Tools Other Books You May Enjoy

Partitions

By default, a simple HQL query scans the whole table. This slows down the performance when querying a big table. This issue could be resolved by creating partitions, which are very similar to what's in the RDBMS. In Hive, each partition corresponds to a predefined partition column(s), which maps to subdirectories in the table's directory in HDFS. When the table gets queried, only the required partitions (directory) of data in the table are being read, so the I/O and time of the query is greatly reduced. Using partition is a very easy and effective way to improve performance in Hive.

The following is an example of partition creation in HQL:

> CREATE TABLE employee_partitioned (
> name STRING,
> work_place ARRAY<STRING>,
> gender_age STRUCT<gender:STRING,age:INT>,
> skills_score MAP<STRING,INT>,
> depart_title MAP<STRING...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}