private GenericChangeTaskWriter buildChangeWriter() {
    if (table.isUnkeyedTable()) {
      throw new IllegalArgumentException("UnKeyed table UnSupport change writer");
    }
    KeyedTable table = (KeyedTable) this.table;

    FileFormat fileFormat =
        FileFormat.valueOf(
            (table
                .properties()
                .getOrDefault(
                    TableProperties.CHANGE_FILE_FORMAT, TableProperties.CHANGE_FILE_FORMAT_DEFAULT)
                .toUpperCase(Locale.ENGLISH)));
    long fileSizeBytes;
    if (this.targetFileSize == null) {
      fileSizeBytes =
          PropertyUtil.propertyAsLong(
              table.properties(),
              TableProperties.WRITE_TARGET_FILE_SIZE_BYTES,
              TableProperties.WRITE_TARGET_FILE_SIZE_BYTES_DEFAULT);
    } else {
      fileSizeBytes = this.targetFileSize;
    }
    long mask =
        PropertyUtil.propertyAsLong(
                table.properties(),
                TableProperties.CHANGE_FILE_INDEX_HASH_BUCKET,
                TableProperties.CHANGE_FILE_INDEX_HASH_BUCKET_DEFAULT)
            - 1;
    Schema changeWriteSchema = SchemaUtil.changeWriteSchema(table.changeTable().schema());
    FileAppenderFactory<Record> appenderFactory =
        TableTypeUtil.isHive(table)
            ? new AdaptHiveGenericAppenderFactory(changeWriteSchema, table.spec())
            : new GenericAppenderFactory(changeWriteSchema, table.spec());
    return new GenericChangeTaskWriter(
        fileFormat,
        appenderFactory,
        new CommonOutputFileFactory(
            table.changeLocation(),
            table.spec(),
            fileFormat,
            table.io(),
            table.changeTable().encryption(),
            partitionId,
            taskId,
            transactionId),
        table.io(),
        fileSizeBytes,
        mask,
        table.changeTable().schema(),
        table.spec(),
        table.primaryKeySpec(),
        changeAction,
        orderedWriter);
  }
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