At the end of this video the student will know how and why to use the GROUPING SETS option in Hive.
- [Instructor] Here we're going to take a look at…enhanced aggregations with grouping sets,…which sounds confusing, so let's break it down first.…Grouping sets is a way that you can ask Hive…to return multiple levels of aggregation…in just one SELECT statement.…That's how the GROUPING SETS works,…you pass in a set of things to do GROUP BY functions on,…and it will return all the different levels of aggregation.…Looking at it here, if we had a very basic query…with SELECT a and b and sum of c,…so we're adding up all the values in c,…from MyTable, group by a and b,…and then we return GROUPING SETS,…so this is an additional clause that we can add…to provide additional levels of aggregation.…
What this would bring back is it would bring back…the combination of a and b, so the typical thing…that we would see where we would have…the sum of c at a and b intersections,…then, because in our grouping set we have…comma a individually and then comma b individually,…we would also receive those aggregations returned,…as if we didn't have b or a in our SELECT statement,…
This course shows how to use Hive to process data. Instructor Ben Sullins starts by showing you how to structure and optimize your data. Next, he explains how to get Hue, the Hadoop user interface, to leverage HiveQL when analyzing data. Using the newly configured option, he then demonstrates how to load data, create aggregate tables for fast query access, and run advanced analytics. He also takes you through managing tables and putting functions to use. This course is designed to help you find new ways to work with datasets so you can answer the tough data science questions that come your way.
- Defining data structures in Hive
- Selecting data
- Joining tables
- Manipulating data
- Filtering results
- Aggregating data
- Using built-in aggregate functions
- Mastering built-in table-generating functions
- Using CUBE and ROLLUP
- Using clauses: WHERE and HAVING
- Using LIKE, JOIN, and SEMI JOIN
- Using functions: String, math, date, and conditional