From the course: Analyzing Big Data with Hive

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Retrieving data from complex structures

Retrieving data from complex structures - Hive Tutorial

From the course: Analyzing Big Data with Hive

Start my 1-month free trial

Retrieving data from complex structures

- [Instructor] Here we're going to go into Working with Complex Data Types. Now, Hive has the ability to store multiple values inside of a single column. This is done using an array, a map, or a struct data types. To describe how they work, an array is a collection of fields with the same data type. An example would be an array of numbers, an array of strings, just basically a list of things. And an array is just a way to keep that list together inside of a single column. A map actually has a key and a value, so it's a bit more complex than an array, it's not just a list of things. It actually is a map where you have, say, A equals one and B equals two. And you refer to these things when you're querying them using the dot notation. So select column one dot A, for example. And we'll take a look at that here in a second. And the last one is a version called struct, and this is a collection of named fields, so it's kind of the most complex version there. So we'll take a look at all three…

Contents