presto-spi/src/main/java/io/prestosql/spi/block/SingleRowBlockWriter.java/SingleRowBlockWriter/checkFieldIndexToWrite
class SingleRowBlockWriter:    private void checkFieldIndexToWrite()
    {
        if (fieldBlockBuilderReturned) {
            throw new IllegalStateException("cannot do sequential write after getFieldBlockBuilder is called");
        }
        if (currentFieldIndexToWrite >= fieldBlockBuilders.length) {
            throw new IllegalStateException("currentFieldIndexToWrite is not valid");
        }
    }