in src/main/java/org/apache/datasketches/hive/theta/UnionSketchUDF.java [66:80]
public BytesWritable evaluate(final BytesWritable firstSketch, final BytesWritable secondSketch,
final int sketchSize, final long seed) {
final Union union = SetOperation.builder().setSeed(seed).setNominalEntries(sketchSize).buildUnion();
if (firstSketch != null && firstSketch.getLength() >= EMPTY_SKETCH_SIZE_BYTES) {
union.union(BytesWritableHelper.wrapAsMemory(firstSketch));
}
if (secondSketch != null && secondSketch.getLength() >= EMPTY_SKETCH_SIZE_BYTES) {
union.union(BytesWritableHelper.wrapAsMemory(secondSketch));
}
return new BytesWritable(union.getResult().toByteArray());
}