From the course: Analyzing Big Data with Hive

Unlock the full course today

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

Simple filter with the WHERE clause

Simple filter with the WHERE clause - Hive Tutorial

From the course: Analyzing Big Data with Hive

Start my 1-month free trial

Simple filter with the WHERE clause

- [Instructor] Let's see now how to actually filter our results using the where clause. This is the clause that allows you to focus your results to a specific context such as a particular region or year or even a partition of the data that you're looking at. We're going to start out by writing a simple select statement, and then we're going to filter using equals and between, two different ways of applying a filter condition. Here in my Cloudera environment, I'll go take a look at the scripts, and I'm going to open 5-1.sql. I'm going to copy this, and then go back to my Hue editor. Now we're going to start by taking a look at using where, and we're filtering to a specific partition in our data set. If you recall in a previous clip, what we had done was created this table sales_all_years and added this partition of 2009, so that actually limits the hive engine when it tries to process this to a specific set of data that was defined when we created our table. If I run this query here…

Contents