PIG UDF throwing error PIG UDF throwing error hadoop hadoop

PIG UDF throwing error


It appears that your problem may be that you are casting your input to a String in your status UDF. Your fm UDF actually returns an Integer. So instead you should have:

Integer i = (Integer)input.get(0);

This definitely will cause a problem unless you fix it. Without the original error message I can't say whether or not there is some other problem that occurs earlier.

I would have expected your stack trace to include the original exception message, which would help you debug this issue. Strange that it doesn't. Without it all you have to go off of is analyzing the code.

This might help with debugging in the future:

throw new IOException("Caught exception processing input row " + e.getMessage(), e);

For the fm UDF, I also recommend making the variables temp, per, and count local to the exec method instead of instances of the class, because they don't need to be. This probably won't cause an error but it is better coding practice.