From the course: Hadoop for Data Science Tips, Tricks, & Techniques

Unlock the full course today

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

Structs in Hive

Structs in Hive - Hadoop Tutorial

From the course: Hadoop for Data Science Tips, Tricks, & Techniques

Start my 1-month free trial

Structs in Hive

- [Instructor] So far we've looked at how to work with these complex data types of maps and arrays using just the syntax to actually pull apart those pieces. Here we're going to take a look at structs, and in a struct, we have some other options that we can use, so we'll explore a few different ways to work with this data. I have here my customers table, which we loaded with the samples. Inside of here, I have orders, addresses, and the orders themselves have a struct inside of them and the email_preferences are at struct at the lowest level with another struct embedded, so you can see there's lots of different complex things going on here. Now, let's take a look if we can get just the name and then the orders for each customer. I'll start with select name as customer_name and the orders, from customers, and I'll just pull back top 10. You can see I have each customer and their orders, and we already looked at how to pull apart which order, but what if I wanted to see all of them?…

Contents