Created
July 20, 2015 23:55
-
-
Save tdunning/0c2cc2089e6cd8c030c0 to your computer and use it in GitHub Desktop.
Random number generate as UDF.
This file contains hidden or 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
public class RandomNumberGenerator { | |
@FunctionTemplate(name = "random", scope = FunctionTemplate.FunctionScope.SIMPLE, nulls = FunctionTemplate.NullHandling.NULL_IF_NULL) | |
public static class Uniform implements DrillSimpleFunc { | |
@Param | |
Float8Holder low; | |
@Param | |
Float8Holder high; | |
@Output | |
Float8Holder output; | |
public void setup() { | |
} | |
public void eval() { | |
java.lang.System.out.printf("into eval\n"); | |
output.value = com.mapr.drill.RandomHelper.nextUniform(low.value, high.value); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment