Friday, March 30, 2012

Data type in hive : What all data types we can specify in hive


Type of Data                   Size Limit
-----------------------------------------------
TINYINT                          1 byte
SMALLINT                      2 byte

INT                                  4 byte
BIGINT                            8 byte
FLOAT                            4 byte  (single precision floating point numbers)
DOUBLE                         8 byte (double precision floating point numbers)
BOOLEAN                       TRUE/FALSE value
STRING                           Max size is 2GB.

Maps:  : Contains Key Pair Value 
Arrays  : Contains collection of same data types
Structs : Contains collection of different data types

Syntax of creating table in hive :





CREATE (DATABASE|SCHEMA) [IF NOT EXISTS] database_name
[COMMENT database_comment] [LOCATION hdfs_path]
...)];
[WITH DBPROPERTIES (property_name=property_value,


Example :


CREATE TABLE example_hive_data
(
human                ARRAY<string>,
addresses           MAP<STRING, STRING>,


emails                 STRUCT<color: STRING, wheel_size: FLOAT>
);


For better understanding Visit Following Link :

No comments:

Post a Comment

Thank you for Commenting Will reply soon ......

Featured Posts

#Linux Commands Unveiled: #date, #uname, #hostname, #hostid, #arch, #nproc

 #Linux Commands Unveiled: #date, #uname, #hostname, #hostid, #arch, #nproc Linux is an open-source operating system that is loved by millio...