in src/main/java/org/apache/datasketches/pig/tuple/UnionArrayOfDoublesSketchBase.java [78:94]
public void accumulate(final Tuple inputTuple) throws IOException {
if (this.isFirstCall_) {
// this is to see in the log which way was used by Pig
Logger.getLogger(getClass()).info("accumulator is used");
this.isFirstCall_ = false;
}
if (inputTuple == null || inputTuple.size() != 1) {
return;
}
final DataBag bag = (DataBag) inputTuple.get(0);
if (bag == null || bag.size() == 0) { return; }
if (this.accumUnion_ == null) {
this.accumUnion_ = new ArrayOfDoublesSetOperationBuilder().setNominalEntries(this.sketchSize_)
.setNumberOfValues(this.numValues_).buildUnion();
}
updateUnion(bag, this.accumUnion_);
}