public void update()

in src/main/java/org/apache/datasketches/hive/theta/UnionState.java [66:101]


  public void update(final Object value, final PrimitiveObjectInspector objectInspector) {
    switch (objectInspector.getPrimitiveCategory()) {
    case BINARY:
      this.union_.update(PrimitiveObjectInspectorUtils.getBinary(value, objectInspector).copyBytes());
      return;
    case BYTE:
      this.union_.update(PrimitiveObjectInspectorUtils.getByte(value, objectInspector));
      return;
    case DOUBLE:
      this.union_.update(PrimitiveObjectInspectorUtils.getDouble(value, objectInspector));
      return;
    case FLOAT:
      this.union_.update(PrimitiveObjectInspectorUtils.getFloat(value, objectInspector));
      return;
    case INT:
      this.union_.update(PrimitiveObjectInspectorUtils.getInt(value, objectInspector));
      return;
    case LONG:
      this.union_.update(PrimitiveObjectInspectorUtils.getLong(value, objectInspector));
      return;
    case STRING:
      this.union_.update(PrimitiveObjectInspectorUtils.getString(value, objectInspector));
      return;
    case CHAR:
      this.union_.update(PrimitiveObjectInspectorUtils.getHiveChar(value, objectInspector).getValue());
      return;
    case VARCHAR:
      this.union_.update(PrimitiveObjectInspectorUtils.getHiveVarchar(value, objectInspector).getValue());
      return;
    default:
      throw new IllegalArgumentException(
        "Unrecongnized input data type " + value.getClass().getSimpleName() + " category "
        + objectInspector.getPrimitiveCategory() + ", please use data of the following types: "
        + "byte, double, float, int, long, char, varchar or string.");
    }
  }