def lower_column(col):

    old = None
    while col is not None and col is not old:
        old = col
        if not hasattr(col, 'table') or not hasattr(col.table, 'froms'):
            return col
        for f in col.table.froms:
            if f.corresponding_column(col) is not None:
                col = f.corresponding_column(col)

    return old
Return column from lower level tables if possible
dataset/ETHPy150Open blaze/blaze/blaze/compute/sql.py/lower_column