Skip to content
Permalink
Browse files
Fix Static access calls
  • Loading branch information
leerho committed Apr 17, 2017
1 parent 086e68b commit fa0581aee9c95555af9d8c6176df288d5bf5c453
Showing 2 changed files with 4 additions and 3 deletions.
@@ -12,6 +12,7 @@
import org.apache.pig.data.Tuple;

import com.yahoo.memory.NativeMemory;
import com.yahoo.sketches.quantiles.DoublesSketch;
import com.yahoo.sketches.quantiles.UpdateDoublesSketch;
import com.yahoo.sketches.tuple.DoubleSummary;
import com.yahoo.sketches.tuple.Sketch;
@@ -40,11 +41,11 @@ public Double exec(final Tuple input) throws IOException {
final Sketch<DoubleSummary> sketch = Sketches.heapifySketch(new NativeMemory(dba.get()));

final double percentile = (double) input.get(1);
if (percentile < 0 || percentile > 100) {
if ((percentile < 0) || (percentile > 100)) {
throw new IllegalArgumentException("percentile must be between 0 and 100");
}

final UpdateDoublesSketch qs = UpdateDoublesSketch.builder().build(QUANTILES_SKETCH_SIZE);
final UpdateDoublesSketch qs = DoublesSketch.builder().build(QUANTILES_SKETCH_SIZE);
final SketchIterator<DoubleSummary> it = sketch.iterator();
while (it.next()) {
qs.update(it.getSummary().getValue());
@@ -151,7 +151,7 @@ public void algebraicIntermediateFinalNormalCase() throws Exception {
}

{ // this is to simulate an output from a prior call of IntermediateFinal
UpdateDoublesSketch qs = UpdateDoublesSketch.builder().build();
UpdateDoublesSketch qs = DoublesSketch.builder().build();
qs.update(2.0);
bag.add(tupleFactory.newTuple(new DataByteArray(qs.toByteArray())));
}

0 comments on commit fa0581a

Please sign in to comment.