in src/main/java/org/apache/datasketches/hive/theta/IntersectSketchUDF.java [59:73]
public BytesWritable evaluate(final BytesWritable firstSketchBytes,
final BytesWritable secondSketchBytes, final long hashSeed) {
Sketch firstSketch = null;
if (firstSketchBytes != null && firstSketchBytes.getLength() > 0) {
firstSketch = Sketch.wrap(BytesWritableHelper.wrapAsMemory(firstSketchBytes), hashSeed);
}
Sketch secondSketch = null;
if (secondSketchBytes != null && secondSketchBytes.getLength() > 0) {
secondSketch = Sketch.wrap(BytesWritableHelper.wrapAsMemory(secondSketchBytes), hashSeed);
}
final Intersection intersect = SetOperation.builder().setSeed(hashSeed).buildIntersection();
return new BytesWritable(intersect.intersect(firstSketch, secondSketch).toByteArray());
}