Data Science Hadoop HDFS HBase Hive Pig Chukwa MapReduce EC2 SharePoint Spark Storm Kafka Docker
Friday, May 17, 2013
Friday, April 19, 2013
Thursday, March 21, 2013
Tuesday, March 12, 2013
Tuesday, February 19, 2013
Sunday, January 13, 2013
Friday, August 31, 2012
Extending Hive : Custom Mapper & Reducer
Hive : A data warehouse system on top of hadoop for adhoc query.
- Query get converted into map & reduce tasks and run in parallel on number of nodes and bring back result quickly from any kind of massive data.
- Hive also allow us to extend and write our implementation for map & reduce job. These can be done with scripts written in any programming language and then used as hive-functions.
- Extending Mapper : By default hive support few inputFormat where every line is separated by '\n' and fields are separated by ',' or '|' etc. But when data is not in a format which hive can understand, we can write logic to parse data in extending mapper class and then emit key-values pairs. Hive provides us to extend GenericUDTF (User Defined Transform Function) class for this purpose.
- Extending Reducer : Same way we can derive more results in custom reducer by extending GenericUDAF (User Defined Aggregate Function). Results can be filtered and passed to multiple/different tables.
Thank You
Subscribe to:
Posts (Atom)