def get_index_for_column(dataset, col_id):
    """Get index position for column with given id in dataset schema.

    Raises ValueError if no column with col_id exists.

    Parameters
    ----------
    dataset: vizier.datastore.base.DatasetHandle
        Handle for dataset
    col_id: int
        Unique column identifier

    Returns
    -------
    int
    """
    for i in range(len(dataset.columns)):
        if dataset.columns[i].identifier == col_id:
            return i
    # Raise ValueError if no column was found
    raise ValueError('unknown column identifier \'' + str(col_id) + '\'')