Hive Complex Data Types Tutorial | Hive Complex Data Types Example | Hive Complex Queries

Опубликовано: 10 Октябрь 2024
на канале: ACADGILD
4,440
67

Hive Complex Data Types Tutorial | Hive Complex Data Types Example | Hive Complex Queries
https://acadgild.com/big-data/big-dat...
Hello and welcome back to Hadoop tutorials powered by Acadgild. In this video, you will be able to learn the Hive Complex Data Types.
Hive Complex Data Types:
• Complex Types can be built up from primitive types and other composite types
• Data type of the fields in the collection are specified using an angled bracket notation
• Currently, Hive supports four complex data types

ARRAY:
• ARRAY (data..type)
• An ordered sequence of similar type elements that are indexable using
• Zero-based integers
• It is similar to arrays in Java.
• Example – array (‘sivs’,’bala’,’praveen’);
• Second element is accessed with array[1]

MAP
• MAP (primitive..type, data..type)
• Collection of key value pairs
• Fields are accessed using array notation of keys (e.g., [‘key’]

STRUCT
• STRUCT (col..name : data..type [COMMENT col..comment],…)
• It is similar to STRUCT in C language.
• It is a record type which encapsulates a set of named fields that can be any primitive data types.
• Elements in STRUCT type are accessed using the DOT (.) notation
• Example- For a column c of type STRUCT {a INT; b INT} the a field is accessed by the expression c.a

UNIONTYPE
• UNIONTYPE(data..type, data..type,…)
• It is similar to Unions in C
• At any point of time, an Union Type can hold anyone (exactly one) data type from its specified data types
Kindly go through the Demo and please subscribe and stay tuned for more such videos.

#Hive #types, #hivetable, #Hivetutorial,

For more updates on courses and tips follow us on:
Facebook:   / acadgild  
Twitter:   / acadgild  
LinkedIn:   / acadgild