Hive
What is Hive? Architecture & Modes
In this tutorial, you will learn- What is Hive? Hive Architecture Different modes of Hive What is...
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 "gtupapers"
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 gtupapers
In the above screenshot, we are doing two things
In this tutorial, you will learn- What is Hive? Hive Architecture Different modes of Hive What is...
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...
In this tutorial, you will learn- Join queries Different type of joins Sub queries Embedding custom...
Table Operations such as Creation, Altering, and Dropping tables in Hive can be observed in this...
Functions are built for a specific purpose to perform operations like Mathematical, arithmetic,...