Skip to Content
Apache Hive Cookbook
book

Apache Hive Cookbook

by Hanish Bansal, Saurabh Chauhan, Shrey Mehrotra
April 2016
Beginner content levelBeginner
268 pages
5h 32m
English
Packt Publishing
Content preview from Apache Hive Cookbook

Using the built-in User Defined Table Function (UDTF)

Normal functions take one row as input and provide one row as transformed output. On the other side, built-in table-generating functions take one row as input and produce multiple output rows.

How to do it…

The built-in table-generating functions could be used directly in the query. The following are some examples of the table-generating functions available in Hive:

Function Name

Return Type

Description

explode(ARRAY)

N rows

It will return n of rows where n is the size of an array. This function represents each element of an array as a row.

explode(MAP)

N rows

It will return n number of rows where n is the size of a map. This function represents each key-value element of the map as a ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Introduction to Apache Hive

Introduction to Apache Hive

Tom Hanlon

Publisher Resources

ISBN: 9781782161080Supplemental Content