@Override
    public void write(T row) throws IOException {
        checkFailure();
        PartitionKey partitionKey = partition(row);
        if (latestPartitionPath == null || !partitionKey.toPath().equals(latestPartitionPath)) {
            // NOTICE: we need to copy a new partition key here, in case of messing up the keys in writers.
            closeCurrentWriter();
            latestWriter = new RollingFileWriter(partitionKey.copy());
            latestPartitionPath = partitionKey.toPath();
        }

        latestWriter.write(row);
    }
Create a PartitionKey from the values in row.
<p>
Any PartitionKey returned by this method can be reused by the implementation.

@param row a data row
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/iceberg/src/main/java/org/apache/inlong/sort/iceberg/sink/GroupedPartitionedFanoutWriter.java