public void accumulate()

in src/main/java/org/apache/datasketches/pig/quantiles/DataToItemsSketch.java [182:197]


  public void accumulate(final Tuple inputTuple) throws IOException {
    if ((inputTuple == null) || (inputTuple.size() == 0)) { return; }
    final DataBag bag = (DataBag) inputTuple.get(0);
    if (bag == null) { return; }
    if (this.accumUnion_ == null) {
      this.accumUnion_ = this.k_ > 0
        ? ItemsUnion.getInstance(this.k_, this.comparator_)
        : ItemsUnion.getInstance(this.comparator_);
    }
    for (final Tuple innerTuple: bag) {
      final Object value = innerTuple.get(0);
      if (value != null) {
        this.accumUnion_.update(extractValue(value));
      }
    }
  }