@Override
    public Row projectColumnsToWrite(Row in) {
        return partitionIndexes.length == 0 ? in : Row.project(in, nonPartitionIndexes);
    }
@Test
    void testProjectColumnsToWrite() {
        Row projected1 =
                new RowPartitionComputer(
                                "",
                                new String[] {"f1", "p1", "p2", "f2"},
                                new String[] {"p1", "p2"})
                        .projectColumnsToWrite(Row.of(1, 2, 3, 4));
        assertThat(projected1).isEqualTo(Row.of(1, 4));

        Row projected2 =
                new RowPartitionComputer(
                                "",
                                new String[] {"f1", "f2", "p1", "p2"},
                                new String[] {"p1", "p2"})
                        .projectColumnsToWrite(Row.of(1, 2, 3, 4));
        assertThat(projected2).isEqualTo(Row.of(1, 2));

        Row projected3 =
                new RowPartitionComputer(
                                "",
                                new String[] {"f1", "p1", "f2", "p2"},
                                new String[] {"p1", "p2"})
                        .projectColumnsToWrite(Row.of(1, 2, 3, 4));
        assertThat(projected3).isEqualTo(Row.of(1, 3));
    }