public InternalRow setFileOffset(Long fileOffset) {
    List<DataType> dataTypeList =
        Arrays.stream(schema.fields()).map(StructField::dataType).collect(Collectors.toList());
    List<Object> objectSeq = new ArrayList<>(dataTypeList.size() + 1);
    row.toSeq(schema).toStream().foreach(objectSeq::add);
    objectSeq.add(fileOffset);
    return new GenericInternalRow(objectSeq.toArray());
  }
cast internal row to upsert internal row
amoro-format-mixed/amoro-mixed-spark/v3.5/amoro-mixed-spark-3.5/src/main/java/org/apache/amoro/spark/SparkInternalRowCastWrapper.java