At the end of this video the student will know how to make an if and case statement in Hive.
- [Voiceover] When we want to query our data…and analyze it, one of the things that poses a challenge…with how SQL works, is it's based on these batch operations.…We run a function and calculation…on the entire dataset at a time.…Now, conditional statements are a way of separating that out…and adding some more flexibility…with how we actually analyze and calculate things.…These are called conditional operators,…and they're special keywords in Hive,…just as they are in other SQL languages,…to perform these operations that evaluate expressions…and find out what's going on with them,…and return a different result,…based on the output of that expression.…
So, the basic way we do this is,…we identify things with IF.…We're going to use IF as a way to identify large sales,…in our demo here.…Then we're going to create a sales size category,…so, is it a small, medium, or large sale, using CASE.…CASE is similar to IF, just more of a…cascading way of doing it.…And then we'll do some what-if analysis,…by combining regions in an aggregate query.…
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