in src/main/java/org/apache/datasketches/hive/tuple/UnionDoubleSummaryWithModeSketchUDAF.java [100:120]
public ObjectInspector init(final Mode mode, final ObjectInspector[] inspectors) throws HiveException {
final ObjectInspector resultInspector = super.init(mode, inspectors);
if ((mode == Mode.PARTIAL1) || (mode == Mode.COMPLETE)) {
// input is original data
if (inspectors.length > 2) {
this.summaryModeInspector_ = (PrimitiveObjectInspector) inspectors[2];
}
}
if ((mode == Mode.PARTIAL1) || (mode == Mode.PARTIAL2)) {
// intermediate results need to include the nominal number of entries and the summary mode
return ObjectInspectorFactory.getStandardStructObjectInspector(
Arrays.asList(NOMINAL_NUM_ENTRIES_FIELD, SUMMARY_MODE_FIELD, SKETCH_FIELD),
Arrays.asList(
PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(PrimitiveCategory.INT),
PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(PrimitiveCategory.STRING),
PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(PrimitiveCategory.BINARY)
)
);
}
return resultInspector;
}