void update()

in src/main/java/org/apache/datasketches/hive/tuple/ArrayOfDoublesSketchState.java [42:75]


  void update(final Object[] data, final PrimitiveObjectInspector keyInspector,
      final PrimitiveObjectInspector[] valuesInspectors) {
    final double[] values = new double[valuesInspectors.length];
    for (int i = 0; i < values.length; i++) {
      values[i] = PrimitiveObjectInspectorUtils.getDouble(data[i + 1], valuesInspectors[i]);
    }
    switch (keyInspector.getPrimitiveCategory()) {
    case BINARY:
      this.sketch_.update(PrimitiveObjectInspectorUtils.getBinary(data[0], keyInspector).copyBytes(), values);
      return;
    case BYTE:
      this.sketch_.update(PrimitiveObjectInspectorUtils.getByte(data[0], keyInspector), values);
      return;
    case DOUBLE:
      this.sketch_.update(PrimitiveObjectInspectorUtils.getDouble(data[0], keyInspector), values);
      return;
    case FLOAT:
      this.sketch_.update(PrimitiveObjectInspectorUtils.getFloat(data[0], keyInspector), values);
      return;
    case INT:
      this.sketch_.update(PrimitiveObjectInspectorUtils.getInt(data[0], keyInspector), values);
      return;
    case LONG:
      this.sketch_.update(PrimitiveObjectInspectorUtils.getLong(data[0], keyInspector), values);
      return;
    case STRING:
      this.sketch_.update(PrimitiveObjectInspectorUtils.getString(data[0], keyInspector), values);
      return;
    default:
      throw new IllegalArgumentException(
          "Unrecongnized input data type, please use data of type: "
      + "byte, double, float, int, long, or string only.");
    }
  }