refactor for SelectWriter::writeSelectColumns