public int nameToIndex(String name) {
        Integer index = colIndex.get(name);
        if (index == null) {
            throw new NoSuchColumnException("Result has no column with name '" + name + "'");
        }
        return index;
    }
Takes column name and return corresponding index (starting from 0).

@param name - column name
@return - column index starting from 0
client-v2/src/main/java/com/clickhouse/client/api/metadata/TableSchema.java