Package org.apache.pig.piggybank.evaluation.math

Examples of org.apache.pig.piggybank.evaluation.math.ABS


public class TestMathUDF extends TestCase{
    public double delta = 0.001;
   
   public void testABS() throws Exception {
          EvalFunc<DataAtom> ABS = new ABS();
          Tuple tup = new Tuple(1);
          tup.setField(0, -1.0);
          DataAtom output = new DataAtom();
          ABS.exec(tup, output);
          double expected = 1.0;
          double actual = (new Double(output.strval())).doubleValue();
            assertEquals(actual, expected, delta);
      }
View Full Code Here

TOP

Related Classes of org.apache.pig.piggybank.evaluation.math.ABS

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.