Category Archives: Pig

PIG – general stuff

Adding jar REGISTER /local/path/to/myjar_name.jar Set queue name Specify below in the pig script SET mapreduce.job.queuename 'my_queuename'; (or) specify while running the PIG script $ pig -Dmapreduce.job.queuename=my_queuename -f my_script.pig Set job name Specify below in the pig script SET mapreduce.job.name 'Testing HCatalog'; (or) specify while running the PIG script $ pig -Dmapreduce.job.name="Testing HCatalog" -f my_script.pig

Category: Pig

PIG UDF with testNG test case – concatenate two strings

PIG UDF class package org.puneetha.pig.udf; import java.io.IOException; import org.apache.log4j.Logger; import org.apache.pig.EvalFunc; import org.apache.pig.data.Tuple; /*** * * * @author Puneetha * */ public final class ConcatStrPig extends EvalFunc<String>{ private static final Logger logger = Logger.getLogger(Thread.currentThread().getStackTrace()[0].getClassName()); @Override public String exec(final Tuple input) throws IOException { logger.debug("Tuple=" + input.toString()); String separator = " "; StringBuilder result = new… Read More »

Category: Pig

PIG – Commands

PIG Syntax Highlighting in vim http://www.vim.org/scripts/script.php?script_id=2186

Category: Pig

Query Hive table from Pig – using HCatalog

Querying hive table from PIG using HCatalog $cat hcatScript.pig A = LOAD 'db1.tablename' USING org.apache.hcatalog.pig.HCatLoader(); B = LIMIT A 10; dump B; $pig -useHCatalog -f hcatScript.pig Comment below if you find this blog useful.