public void preWrite(List<HoodieRecord> records) {
            // rewrite the first record with expected fileID
            HoodieRecord<?> first = records.get(0);
            HoodieRecord<?> record =
                    new HoodieAvroRecord<>(first.getKey(), (HoodieRecordPayload) first.getData(), first.getOperation());
            HoodieRecordLocation newLoc = new HoodieRecordLocation(first.getCurrentLocation().getInstantTime(), fileID);
            record.setCurrentLocation(newLoc);

            records.set(0, record);
        }
Sets up before flush: patch up the first record with correct partition path and fileID.

<p>Note: the method may modify the given records {@code records}.
inlong-sort/sort-flink/sort-flink-v1.15/sort-connectors/hudi/src/main/java/org/apache/inlong/sort/hudi/sink/StreamWriteFunction.java