Hive provides many built-in functions to aid us in the processing and querying of data. Some of the functionalities provided by these functions include string manipulation, date manipulation, type conversion, conditional operators, mathematical functions, and many more.
This recipe assumes that the earlier recipe has been performed. Install Hive and follow the earlier recipe if you have not done already.
This section demonstrates how to use the parse_url
Hive function to parse the content of a URL:
Start Hive CLI by running the following command:
$ hive
Issue the following command to obtain the
FILE
portion of the small image associated with each book:hive> select isbn, parse_url(image_s, 'FILE') from books limit 10; Total MapReduce jobs = 1 ….. OK 0195153448 /images/P/0195153448.01.THUMBZZZ.jpg 0002005018 /images/P/0002005018.01.THUMBZZZ.jpg 0060973129 /images/P/0060973129.01.THUMBZZZ.jpg …… Time taken: 17.183 seconds, Fetched...