New Apache Pig 0.9 Features – Part 3 (Additional Features)
August 1st, 2011
In addition to the new Macros and Embedding features describe earlier by Daniel Dai, here are a set of additional features in Apache Pig 0.9:
Project-range expression
A common use case we have seen is people want to operate on certain columns and project other columns as is or pass a range of input columns to a user defined function. In 0.9, you have project-range, which makes it easier to write statements that do just that. It is similar to the previously available star expression except that it lets you specify a start and end column to be projected.
For example, using previous versions of Pig, if you wanted to replace the IP address field in your input with city and state, the query would like following: