@Override
  public void update(int ordinal, Object value) {
    if (ordinal < metaFields.length) {
      if (value instanceof UTF8String) {
        metaFields[ordinal] = (UTF8String) value;
      } else if (value instanceof String) {
        metaFields[ordinal] = UTF8String.fromString((String) value);
      } else {
        throw new IllegalArgumentException(
            String.format("Could not update the row at (%d) with value of type (%s), either UTF8String or String are expected", ordinal, value.getClass().getSimpleName()));
      }
    } else {
      sourceRow.update(rebaseOrdinal(ordinal), value);
    }
  }
@Test
  public void testUpdate() {
    Object[] values = getRandomValue(true);
    InternalRow row = new GenericInternalRow(values);
    HoodieInternalRow hoodieInternalRow = new HoodieInternalRow(UTF8String.fromString("commitTime"),
        UTF8String.fromString("commitSeqNo"),
        UTF8String.fromString("recordKey"),
        UTF8String.fromString("partitionPath"),
        UTF8String.fromString("fileName"),
        row,
        true);

    hoodieInternalRow.update(0, "commitTime_updated");
    hoodieInternalRow.update(1, "commitSeqNo_updated");
    hoodieInternalRow.update(2, "recordKey_updated");
    hoodieInternalRow.update(3, "partitionPath_updated");
    hoodieInternalRow.update(4, "fileName_updated");

    values = getRandomValue(true);
    hoodieInternalRow.update(INTEGER_INDEX, values[INTEGER_INDEX]);
    hoodieInternalRow.update(BOOLEAN_INDEX, values[BOOLEAN_INDEX]);
    hoodieInternalRow.update(SHORT_INDEX, values[SHORT_INDEX]);
    hoodieInternalRow.update(BYTE_INDEX, values[BYTE_INDEX]);
    hoodieInternalRow.update(LONG_INDEX, values[LONG_INDEX]);
    hoodieInternalRow.update(FLOAT_INDEX, values[FLOAT_INDEX]);
    hoodieInternalRow.update(DOUBLE_INDEX, values[DOUBLE_INDEX]);
    //hoodieInternalRow.update(decimalIndex, values[decimalIndex]);
    hoodieInternalRow.update(BINARY_INDEX, values[BINARY_INDEX]);
    hoodieInternalRow.update(STRUCT_INDEX, values[STRUCT_INDEX]);
    hoodieInternalRow.update(STRING_INDEX, values[STRING_INDEX].toString());

    assertValues(hoodieInternalRow, "commitTime_updated", "commitSeqNo_updated", "recordKey_updated", "partitionPath_updated",
        "fileName_updated", values, nullIndices);
  }