public SortedPosDeleteWriter<Record> buildBasePosDeleteWriter(
      long mask, long index, StructLike partitionKey) {
    writeBasePreconditions();
    UnkeyedTable baseTable =
        this.table.isKeyedTable() ? table.asKeyedTable().baseTable() : table.asUnkeyedTable();
    FileFormat fileFormat =
        FileFormat.valueOf(
            (baseTable
                .properties()
                .getOrDefault(
                    TableProperties.BASE_FILE_FORMAT, TableProperties.BASE_FILE_FORMAT_DEFAULT)
                .toUpperCase(Locale.ENGLISH)));
    GenericAppenderFactory appenderFactory =
        new GenericAppenderFactory(baseTable.schema(), baseTable.spec());
    appenderFactory.set(
        org.apache.iceberg.TableProperties.METRICS_MODE_COLUMN_CONF_PREFIX
            + MetadataColumns.DELETE_FILE_PATH.name(),
        MetricsModes.Full.get().toString());
    appenderFactory.set(
        org.apache.iceberg.TableProperties.METRICS_MODE_COLUMN_CONF_PREFIX
            + MetadataColumns.DELETE_FILE_POS.name(),
        MetricsModes.Full.get().toString());
    return new SortedPosDeleteWriter<>(
        appenderFactory,
        new CommonOutputFileFactory(
            baseTable.location(),
            baseTable.spec(),
            fileFormat,
            baseTable.io(),
            baseTable.encryption(),
            partitionId,
            taskId,
            transactionId),
        table.io(),
        fileFormat,
        mask,
        index,
        partitionKey);
  }
Builder to create writers for {@link KeyedTable} writing {@link Record}.
amoro-format-mixed/amoro-mixed-hive/src/main/java/org/apache/amoro/hive/io/writer/AdaptHiveGenericTaskWriterBuilder.java