Examples of strVal()


Examples of org.apache.pig.data.DataAtom.strval()

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

Examples of org.apache.pig.data.DataAtom.strval()

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

Examples of org.apache.pig.data.DataAtom.strval()

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

Examples of org.apache.pig.data.DataAtom.strval()

          Tuple tup = new Tuple(1);
          tup.setField(0, 0.5);
          DataAtom output = new DataAtom();
          ULP.exec(tup, output);
          double expected = Math.ulp(0.5);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
   }
  
}
View Full Code Here

Examples of org.apache.pig.data.DataAtom.strval()

    try {
      for (Tuple t : tuples) {
        DataAtom atom = new DataAtom();
        eval.exec(t, atom);
        System.out.println("Converted: " + t + " to (" + atom + ")");
        res.add(atom.strval());
      }
    } catch (IOException e) {
      e.printStackTrace();
      System.exit(1);
    }
View Full Code Here

Examples of org.apache.solr.search.function.DocValues.strVal()

          vals[1] = y.doubleVal(doc);
        }
        @Override
        public void strVal(int doc, String[] vals) {
          vals[0] = x.strVal(doc);
          vals[1] = y.strVal(doc);
        }
        @Override
        public String toString(int doc) {
          return name() + "(" + x.toString(doc) + "," + y.toString(doc) + ")";
        }
View Full Code Here

Examples of org.apache.solr.search.function.DocValues.strVal()

    final DocValues str2DV = str2.getValues(context, reader);
    return new DocValues() {

      @Override
      public float floatVal(int doc) {
        return dist.getDistance(str1DV.strVal(doc), str2DV.strVal(doc));
      }

      @Override
      public int intVal(int doc) {
        return (int) doubleVal(doc);
View Full Code Here

Examples of org.apache.solr.search.function.DocValues.strVal()

    SolrIndexReader sr = sqr.getSearcher().getReader();
    int idx = SolrIndexReader.readerIndex(doc, sr.getLeafOffsets());
    int base = sr.getLeafOffsets()[idx];
    SolrIndexReader sub = sr.getLeafReaders()[idx];
    DocValues vals = vs.getValues(context, sub);
    return vals.strVal(doc-base);
  }

  public void testReopen() throws Exception {

    assertU(adoc("id","1", "v_t","Hello Dude", "v_s","string1"));
View Full Code Here

Examples of org.apache.solr.search.function.DocValues.strVal()

    SolrIndexReader sr = sqr.getSearcher().getReader();
    int idx = SolrIndexReader.readerIndex(doc, sr.getLeafOffsets());
    int base = sr.getLeafOffsets()[idx];
    SolrIndexReader sub = sr.getLeafReaders()[idx];
    DocValues vals = vs.getValues(context, sub);
    return vals.strVal(doc-base);
  }

  public void testReopen() throws Exception {

    assertU(adoc("id","1", "v_t","Hello Dude", "v_s","string1"));
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.