Complex Datatypes in Hive
This article takes you through three different complex data types in Hive, which are involved in the table creation.?These complex datatypes are built on primitive datatypes like numeric, date, string etc. Here the example that I have taken is of simple dataset that has information of food ordered.
Dataset used:
Loading dataset into Hadoop:
Creating table in hive:
Load dataset into hive table:
Table after loading data:
Query to get table no and the respective discount given to the customer(where discount is the key in the map price):
Query to get the 2nd item ordered which is stored as array element in items_orderd:
I hope this helped you understand what the complicated datatypes in Hive are. Thanks for your time.