src/main/java/org/apache/datasketches/pig/quantiles/DataToItemsSketch.java [205:227]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  @Override
  public Tuple getValue() {
    if (this.accumUnion_ != null) {
      final ItemsSketch<T> resultSketch = this.accumUnion_.getResultAndReset();
      if (resultSketch != null) {
        return tupleFactory_.newTuple(new DataByteArray(resultSketch.toByteArray(this.serDe_)));
      }
    }
    // return empty sketch
    final ItemsSketch<T> sketch = this.k_ > 0
        ? ItemsSketch.getInstance(this.k_, this.comparator_)
        : ItemsSketch.getInstance(this.comparator_);
    return tupleFactory_.newTuple(new DataByteArray(sketch.toByteArray(this.serDe_)));
  }

  /**
   * Cleans up the UDF state after being called using the {@link Accumulator} interface.
   *
   * @see "org.apache.pig.Accumulator.cleanup()"
   */
  @Override
  public void cleanup() {
    this.accumUnion_ = null;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/main/java/org/apache/datasketches/pig/quantiles/UnionItemsSketch.java [186:208]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  @Override
  public Tuple getValue() {
    if (this.accumUnion_ != null) {
      final ItemsSketch<T> resultSketch = this.accumUnion_.getResultAndReset();
      if (resultSketch != null) {
        return tupleFactory_.newTuple(new DataByteArray(resultSketch.toByteArray(this.serDe_)));
      }
    }
    // return empty sketch
    final ItemsSketch<T> sketch = this.k_ > 0
        ? ItemsSketch.getInstance(this.k_, this.comparator_)
        : ItemsSketch.getInstance(this.comparator_);
    return tupleFactory_.newTuple(new DataByteArray(sketch.toByteArray(this.serDe_)));
  }

  /**
   * Cleans up the UDF state after being called using the {@link Accumulator} interface.
   *
   * @see "org.apache.pig.Accumulator.cleanup()"
   */
  @Override
  public void cleanup() {
    this.accumUnion_ = null;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



