Hive table partition

Partitioning a table means dividing a table into different parts based on a value of a partition key. A partition key can be any column, for example, date, department, country, and so on. As data is stored in parts, the query response time becomes faster. Instead of scanning the whole table, partition creates subfolders within the main table folders. Hive will scan only a specific part or parts of the table based on the query's WHERE clause. Hive table partition is similar to any RDBMS table partition. The purpose is also the same. As we keep inserting data into a table, the table becomes bigger in data size. Let's say we create an ORDERS table as follows:

hive> create database if not exists ORDERS; OK Time taken: 0.036 ...

Get Modern Big Data Processing with Hadoop now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.