Hive
Hive Partitions & Buckets with Example
Tables, Partitions, and Buckets are the parts of Hive data modeling. What is Partitions? Hive...
Data types are very important elements in Hive query language and data modeling. For defining the table column types, we must have to know about the data types and its usage.
The following gives brief overview of some data types present in Hive:
These are
Numeric Types:
Type | Memory allocation |
TINY INT | Its 1-byte signed integer (-128 to 127) |
SMALL INT | 2-byte signed integer (-32768 to 32767) |
INT | 4 –byte signed integer ( -2,147,484,648 to 2,147,484,647) |
BIG INT | 8 byte signed integer |
FLOAT | 4 – byte single precision floating point number |
DOUBLE | 8- byte double precision floating point number |
DECIMAL | We can define precision and scale in this Type |
String Types:
Type | Length |
CHAR | 255 |
VARCHAR | 1 to 65355 |
STRING | We can define length here(No Limit) |
Date/Time Types:
Type | Usage |
Timestamp | Supports traditional Unix timestamp with optional nanosecond precision |
Date |
|
Complex Types:
Type | Usage |
Arrays | ARRAY<data_type> Negative values and non-constant expressions not allowed |
Maps | MAP<primitive_type, data_type> Negative values and non-constant expressions not allowed |
Structs | STRUCT<col_name :datat_type, ….. > |
Union | UNIONTYPE<data_type, datat_type, ……> |
Create Database:
For creating database in Hive shell, we have to use the command as shown in syntax below:-
Syntax:
Create database <DatabaseName>
Example: -Create database "guru99"
From the above screen shot, we are doing two things
Drop Database:
For Dropping database in Hive shell, we have to use the "drop" command as shown in syntax below:-
Syntax:
Drop database <DatabaseName>
Example:-
Drop database guru99
In the above screenshot, we are doing two things
Tables, Partitions, and Buckets are the parts of Hive data modeling. What is Partitions? Hive...
Table Operations such as Creation, Altering, and Dropping tables in Hive can be observed in this...
In this tutorial, you will learn- Join queries Different type of joins Sub queries Embedding custom...
Hive as an ETL and data warehousing tool on top of Hadoop ecosystem provides functionalities like...
Hive provides SQL type querying language for the ETL purpose on top of Hadoop file system. Hive Query...
Prior to Apache Hive installation we require dedicated Hadoop installation, up and running with...