Book Image

Apache Hive Cookbook

Book Image

Apache Hive Cookbook

Overview of this book

Hive was developed by Facebook and later open sourced in Apache community. Hive provides SQL like interface to run queries on Big Data frameworks. Hive provides SQL like syntax also called as HiveQL that includes all SQL capabilities like analytical functions which are the need of the hour in today’s Big Data world. This book provides you easy installation steps with different types of metastores supported by Hive. This book has simple and easy to learn recipes for configuring Hive clients and services. You would also learn different Hive optimizations including Partitions and Bucketing. The book also covers the source code explanation of latest Hive version. Hive Query Language is being used by other frameworks including spark. Towards the end you will cover integration of Hive with these frameworks.
Table of Contents (19 chapters)
Apache Hive Cookbook
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Index

Introduction


In previous chapters, you learned the installation of different Hive components such as Hive metastore, HiveServer2, and working with different services in Hive.

In this chapter, we will cover the following sub topics:

  • Using data types

  • Using operators

  • Partitioning

  • Bucketing

Introducing data types

Hive supports various data types that are primarily divided into two parts:

  • Primitive data types

  • Complex data types

Hive supports many primitive data types that are similar to relational databases, such as INT, SMALLINT, TINYINT, BIGINT, BOOLEAN, FLOAT, and DOUBLE. In addition to primitive data type, Hive also supports few complex data types, such as ARRAY, MAP, STRUCT, and UNION.

Primitive data types

Hive supports large number of primitive data types, which are divided into the four following different categories:

  • Numeric data types

  • String data types

  • Date/Time data type

  • Miscellaneous data types

All these primitive data types are similar to RDBMS primitive data types.

Complex data types

The following...