Last active
December 13, 2015 22:28
-
-
Save cstenac/4984185 to your computer and use it in GitHub Desktop.
Simple Hive UDF (2)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** A simple UDF to get the absolute value of a number */ | |
public class AbsValue extends UDF { | |
public double evaluate(double value) { | |
return Math.abs(value); | |
} | |
public long evaluate(long value) { | |
return Math.abs(value); | |
} | |
public int evaluate(int value) { | |
return Math.abs(value); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment