Examples of exec()


Examples of org.apache.pig.piggybank.evaluation.math.FLOOR.exec()

   public void testFLOOR() throws Exception{
       EvalFunc<DataAtom> FLOOR = new FLOOR();
          Tuple tup = new Tuple(1);
          tup.setField(0, 0.5);
          DataAtom output = new DataAtom();
          FLOOR.exec(tup, output);
          double expected = Math.floor(0.5);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
   }
  
View Full Code Here

Examples of org.apache.pig.piggybank.evaluation.math.HYPOT.exec()

          EvalFunc<DataAtom> HYPOT = new HYPOT();
          Tuple tup = new Tuple(2);
          tup.setField(0, -0.5);
          tup.setField(1,0.6);
          DataAtom output = new DataAtom();
          HYPOT.exec(tup, output);
          double expected = Math.hypot(-0.5,0.6);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
      }
  
View Full Code Here

Examples of org.apache.pig.piggybank.evaluation.math.IEEEremainder.exec()

          EvalFunc<DataAtom> IEEEremainder = new IEEEremainder();
          Tuple tup = new Tuple(2);
          tup.setField(0, -0.5);
          tup.setField(1,0.6);
          DataAtom output = new DataAtom();
          IEEEremainder.exec(tup, output);
          double expected = Math.IEEEremainder(-0.5,0.6);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
      }
  
View Full Code Here

Examples of org.apache.pig.piggybank.evaluation.math.LOG.exec()

   public void testLOG() throws Exception{
       EvalFunc<DataAtom> LOG = new LOG();
          Tuple tup = new Tuple(1);
          tup.setField(0, 0.5);
          DataAtom output = new DataAtom();
          LOG.exec(tup, output);
          double expected = Math.log(0.5);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
   }
  
View Full Code Here

Examples of org.apache.pig.piggybank.evaluation.math.LOG10.exec()

   public void testLOG10() throws Exception{
       EvalFunc<DataAtom> LOG10 = new LOG10();
          Tuple tup = new Tuple(1);
          tup.setField(0, 0.5);
          DataAtom output = new DataAtom();
          LOG10.exec(tup, output);
          double expected = Math.log10(0.5);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
   }
  
View Full Code Here

Examples of org.apache.pig.piggybank.evaluation.math.LOG1P.exec()

   public void testLOG1P() throws Exception{
       EvalFunc<DataAtom> LOG1P = new LOG1P();
          Tuple tup = new Tuple(1);
          tup.setField(0, 0.5);
          DataAtom output = new DataAtom();
          LOG1P.exec(tup, output);
          double expected = Math.log1p(0.5);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
   }
  
View Full Code Here

Examples of org.apache.pig.piggybank.evaluation.math.MAX.exec()

          EvalFunc<DataAtom> MAX = new MAX();
          Tuple tup = new Tuple(2);
          tup.setField(0, -0.5);
          tup.setField(1,0.6);
          DataAtom output = new DataAtom();
          MAX.exec(tup, output);
          double expected = Math.max(-0.5,0.6);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
      }
  
View Full Code Here

Examples of org.apache.pig.piggybank.evaluation.math.MIN.exec()

          EvalFunc<DataAtom> MIN = new MIN();
          Tuple tup = new Tuple(2);
          tup.setField(0, -0.5);
          tup.setField(1,0.6);
          DataAtom output = new DataAtom();
          MIN.exec(tup, output);
          double expected = Math.min(-0.5,0.6);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
      }
  
View Full Code Here

Examples of org.apache.pig.piggybank.evaluation.math.POW.exec()

          EvalFunc<DataAtom> POW = new POW();
          Tuple tup = new Tuple(2);
          tup.setField(0, 0.5);
          tup.setField(1,0.6);
          DataAtom output = new DataAtom();
          POW.exec(tup, output);
          double expected = Math.pow(0.5,0.6);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
      }
  
View Full Code Here

Examples of org.apache.pig.piggybank.evaluation.math.RINT.exec()

   public void testRINT() throws Exception{
       EvalFunc<DataAtom> RINT = new RINT();
          Tuple tup = new Tuple(1);
          tup.setField(0, -0.5);
          DataAtom output = new DataAtom();
          RINT.exec(tup, output);
          double expected = Math.rint(0.5);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
   }
  
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.