Example #1
0
    def union(
        self,
        right: TableExpr,
        distinct: bool = False,
    ) -> TableExpr:
        """Compute the set union of two table expressions.

        The input tables must have identical schemas.

        Parameters
        ----------
        right
            Table expression
        distinct
            Only union distinct rows not occurring in the calling table (this
            can be very expensive, be careful)

        Returns
        -------
        TableExpr
            Union of table and `right`
        """
        from .. import operations as ops

        return ops.Union(self, right, distinct=distinct).to_expr()
Example #2
0
def _table_union(left, right, distinct=False):
    """
    Form the table set union of two table expressions having identical
    schemas.

    Parameters
    ----------
    right : TableExpr
    distinct : boolean, default False
        Only union distinct rows not occurring in the calling table (this
        can be very expensive, be careful)

    Returns
    -------
    union : TableExpr
    """
    op = _ops.Union(left, right, distinct=distinct)
    return TableExpr(op)