in src/main/java/org/apache/datasketches/hive/tuple/SketchState.java [45:74]
void update(final Object data, final PrimitiveObjectInspector keyObjectInspector, final U value) {
switch (keyObjectInspector.getPrimitiveCategory()) {
case BINARY:
this.sketch_.update(
PrimitiveObjectInspectorUtils.getBinary(data, keyObjectInspector).copyBytes(), value);
return;
case BYTE:
this.sketch_.update(PrimitiveObjectInspectorUtils.getByte(data, keyObjectInspector), value);
return;
case DOUBLE:
this.sketch_.update(PrimitiveObjectInspectorUtils.getDouble(data, keyObjectInspector), value);
return;
case FLOAT:
this.sketch_.update(PrimitiveObjectInspectorUtils.getFloat(data, keyObjectInspector), value);
return;
case INT:
this.sketch_.update(PrimitiveObjectInspectorUtils.getInt(data, keyObjectInspector), value);
return;
case LONG:
this.sketch_.update(PrimitiveObjectInspectorUtils.getLong(data, keyObjectInspector), value);
return;
case STRING:
this.sketch_.update(PrimitiveObjectInspectorUtils.getString(data, keyObjectInspector), value);
return;
default:
throw new IllegalArgumentException(
"Unrecongnized input data type, please use data of type: "
+ "byte, double, float, int, long, or string only.");
}
}