@Test public void testUpdate() { Object[] values = getRandomValue(true); InternalRow row = new GenericInternalRow(values); HoodieInternalRow hoodieInternalRow = new HoodieInternalRow("commitTime", "commitSeqNo", "recordKey", "partitionPath", "fileName", row); 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(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); }
@Override public void update(int i, Object value) { if (i < HoodieRecord.HOODIE_META_COLUMNS.size()) { switch (i) { case 0: { this.commitTime = value.toString(); break; } case 1: { this.commitSeqNumber = value.toString(); break; } case 2: { this.recordKey = value.toString(); break; } case 3: { this.partitionPath = value.toString(); break; } case 4: { this.fileName = value.toString(); break; } default: throw new IllegalArgumentException("Not expected"); } } else { row.update(i, value); } }
HoodieInternalRow extends InternalRow { @Override public void update(int i, Object value) { if (i < HoodieRecord.HOODIE_META_COLUMNS.size()) { switch (i) { case 0: { this.commitTime = value.toString(); break; } case 1: { this.commitSeqNumber = value.toString(); break; } case 2: { this.recordKey = value.toString(); break; } case 3: { this.partitionPath = value.toString(); break; } case 4: { this.fileName = value.toString(); break; } default: throw new IllegalArgumentException("Not expected"); } } else { row.update(i, value); } } }
HoodieInternalRow extends InternalRow { @Override public void update(int i, Object value) { if (i < HoodieRecord.HOODIE_META_COLUMNS.size()) { switch (i) { case 0: { this.commitTime = value.toString(); break; } case 1: { this.commitSeqNumber = value.toString(); break; } case 2: { this.recordKey = value.toString(); break; } case 3: { this.partitionPath = value.toString(); break; } case 4: { this.fileName = value.toString(); break; } default: throw new IllegalArgumentException("Not expected"); } } else { row.update(i, value); } } HoodieInternalRow(String commitTime, String commitSeqNumber, String recordKey, String partitionPath,
      String fileName, InternalRow row); }
HoodieInternalRow extends InternalRow { @Override public void update(int i, Object value) { if (i < HoodieRecord.HOODIE_META_COLUMNS.size()) { switch (i) { case 0: { this.commitTime = value.toString(); break; } case 1: { this.commitSeqNumber = value.toString(); break; } case 2: { this.recordKey = value.toString(); break; } case 3: { this.partitionPath = value.toString(); break; } case 4: { this.fileName = value.toString(); break; } default: throw new IllegalArgumentException("Not expected"); } } else { row.update(i, value); } } HoodieInternalRow(String commitTime, String commitSeqNumber, String recordKey, String partitionPath,
      String fileName, InternalRow row); @Override int numFields(); @Override void setNullAt(int i); @Override void update(int i, Object value); @Override boolean isNullAt(int ordinal); @Override boolean getBoolean(int ordinal); @Override byte getByte(int ordinal); @Override short getShort(int ordinal); @Override int getInt(int ordinal); @Override long getLong(int ordinal); @Override float getFloat(int ordinal); @Override double getDouble(int ordinal); @Override Decimal getDecimal(int ordinal, int precision, int scale); @Override UTF8String getUTF8String(int ordinal); @Override String getString(int ordinal); @Override byte[] getBinary(int ordinal); @Override CalendarInterval getInterval(int ordinal); @Override InternalRow getStruct(int ordinal, int numFields); @Override ArrayData getArray(int ordinal); @Override MapData getMap(int ordinal); @Override Object get(int ordinal, DataType dataType); @Override InternalRow copy(); }
HoodieInternalRow extends InternalRow { @Override public void update(int i, Object value) { if (i < HoodieRecord.HOODIE_META_COLUMNS.size()) { switch (i) { case 0: { this.commitTime = value.toString(); break; } case 1: { this.commitSeqNumber = value.toString(); break; } case 2: { this.recordKey = value.toString(); break; } case 3: { this.partitionPath = value.toString(); break; } case 4: { this.fileName = value.toString(); break; } default: throw new IllegalArgumentException("Not expected"); } } else { row.update(i, value); } } HoodieInternalRow(String commitTime, String commitSeqNumber, String recordKey, String partitionPath,
      String fileName, InternalRow row); @Override int numFields(); @Override void setNullAt(int i); @Override void update(int i, Object value); @Override boolean isNullAt(int ordinal); @Override boolean getBoolean(int ordinal); @Override byte getByte(int ordinal); @Override short getShort(int ordinal); @Override int getInt(int ordinal); @Override long getLong(int ordinal); @Override float getFloat(int ordinal); @Override double getDouble(int ordinal); @Override Decimal getDecimal(int ordinal, int precision, int scale); @Override UTF8String getUTF8String(int ordinal); @Override String getString(int ordinal); @Override byte[] getBinary(int ordinal); @Override CalendarInterval getInterval(int ordinal); @Override InternalRow getStruct(int ordinal, int numFields); @Override ArrayData getArray(int ordinal); @Override MapData getMap(int ordinal); @Override Object get(int ordinal, DataType dataType); @Override InternalRow copy();  }