src/main/java/org/apache/datasketches/pig/quantiles/DataToItemsSketch.java [335:355]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          } else if (f0 instanceof DataByteArray) { // inputTuple.bag0.dataTupleN.f0:DBA
            // If field 0 of a dataTuple is a DataByteArray we assume it is a sketch
            // due to system bagged outputs from multiple mapper Intermediate functions.
            // Each dataTuple.DBA:sketch will merged into the union.
            final DataByteArray dba = (DataByteArray) f0;
            union.update(ItemsSketch.getInstance(Memory.wrap(dba.get()), this.comparator_, this.serDe_));
          } else {
            throw new IllegalArgumentException("dataTuple.Field0: Is not a DataByteArray: "
                + f0.getClass().getName());
          }
        }
        final ItemsSketch<T> resultSketch = union.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_)));
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/main/java/org/apache/datasketches/pig/quantiles/UnionItemsSketch.java [315:335]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          } else if (f0 instanceof DataByteArray) { //inputTuple.bag0.dataTupleN.f0:DBA
            // If field 0 of a dataTuple is a DataByteArray we assume it is a sketch from a prior call
            // It is due to system bagged outputs from multiple mapper Intermediate functions.
            // Each dataTuple.DBA:sketch will merged into the union.
            final DataByteArray dba = (DataByteArray) f0;
            union.update(ItemsSketch.getInstance(Memory.wrap(dba.get()), this.comparator_, this.serDe_));
          } else {
            throw new IllegalArgumentException("dataTuple.Field0: Is not a DataByteArray: "
              + f0.getClass().getName());
          }
        }
        final ItemsSketch<T> resultSketch = union.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_)));
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



