Official Website: Simple data types =============== Here are some of the simple data types you will need to know and their description: Tinyint - They store 1 byte signed integer for e.g. 17 smallint – They store 2 byte signed integer for e.g. 20 Int – they store 4 byte signed integer for e.g. 25 Bigint – they store 8 byte signed integer for e.g. 9 billion float - They store 4 byte floating point numbers for e.g. 10.5 double - They store 8 byte floating point numbers. This has double precision and the e.g. is highlighted STRING - sequence of characters can be enclosed in single or double quotes. E.g. ‘John’ timestamp – timestamp with nano-second precision. And the e.g. is highlighted 2016-11-12 12:15: Collection data types ================= Map, Struct, and Array are three of the collection data types available. MAP – MAP is a collection of key-value tuples. Elements are accessed by passing the key. For E.g. if a map column called ‘name’ exists, (['first','peter'],['last','mat']) then first name can be accessed by passing the key as highlighted below name[first] STRUCT – It is a collection datatype, wherein the fields are accessed using the dot operator For E.g. if ax` column "name" is defined with struct data type {firstname string, lastname string} with the values peter and mat, struct('peter','mat') then will return the first name. ARRAY – ARRAY is an ordered sequence of the same type of elements. The element in an array can be referenced by passing the appropriate index. for e.g. if the array ‘name’ contains a list of elements like ('peter','mat','joe') Then passing the index 2 to the column, name[2] will return 'joe' since ‘joe’ is in the 2nd index of the array. Remember an array starts with the index 0. In this video we saw the two data types of Apache Hive, simple data types and complex data types. We also explored on how to declare and use these data types in Hive.










