def _get_affected_columns(columns, data_type, data_types):
    """Return columns affected by given data types.

    Given a list of columns and a dictionary of data_types,
    finds all columns that have the datatype data_type.
    Returns all columns having this datatype.
    """
    affected_columns = []
    for column in columns:
        if data_types[column] == data_type:
            affected_columns = affected_columns + [column]

    return affected_columns