def list_known_columns(meta, from_set):
    """
    Get an ordered list of columns from meta's from_set set.

    The from_set set may include items that point to masks. This
    function will replace mask-references with the names of the columns
    those masks point to so that what you get in return is an ordered
    list of column names that definitely exist in meta['columns'].

    .. note:: The meta document must have a set called from_set.

    Parameters
    ----------
    meta : dict
        The meta document.
    from_set : str
        The set name from which the export should be drawn.

    Returns
    -------
    column_names : list
        The column names.
    """

    column_names = []
    for col in meta['sets'][from_set ]['items']:
        pointer, name = col.split('@')
        if pointer=='columns':
            if name in meta['columns'] and not name in column_names:
                column_names.append(name)
        elif pointer=='masks':
            for item in meta['masks'][name]['items']:
                name =  item['source'].split('@')[1]
                if name in meta['columns'] and not name in column_names:
                    column_names.append(name)
    return column_names