From the course: Analyzing Big Data with Hive

Unlock the full course today

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

String functions

String functions - Hive Tutorial

From the course: Analyzing Big Data with Hive

Start my 1-month free trial

String functions

- [Instructor] Let's dive in here and look at actually manipulating strings in Hive. Now, what we're going to do is use the string manipulation functions that come in HiveQL to change data inside a table or query. The first thing we're going to do is create a new customer key. Then, we're going to parse a URL, which has a special function that we can use. And lastly, we'll use the substring function to add to our customer key that we create in step one. Here in my Cloudera environment I'm going to open up the scripts folder, which has the exercise files for this course. And I'm going to open 7-2.sql. Once I have that I'm just going to copy this and go back to my Hive editor and paste it in. And, the first example we're going to do here is just to find a new customer key. We're going to use lower to make the lowercase name. Then, we're going to use a different function, regexp replace, regexp stands for regular expression, and it's a way of identifying certain characters and in this…

Contents