def safe_union_two_by_name(df1, df2):
    """Combine common fields from two dataframes rowwise.

    Note we do not use the ``pyspark.sql.DataFrame.unionByName``
    function here because we explicitly reorder columns to the
    order of ``take``.

    Parameters
    ----------
    df1 : pyspark.sql.DataFrame
        first dataframe to combine
    df2 : pyspark.sql.DataFrame
        second dataframe to combine

    Returns
    -------
    out : pyspark.sql.DataFrame

    """
    take = [c for c in df1.columns if c in df2.columns]
    df1 = df1.select(take)
    df2 = df2.select(take)
    out = df1.union(df2)
    return out