Exemple #1
0
    def to_array(self) -> ir.ColumnExpr:
        """View a single column table as an array.

        Returns
        -------
        ValueExpr
            A single column view of a table
        """
        from .. import operations as ops

        schema = self.schema()
        if len(schema) != 1:
            raise com.ExpressionError(
                'Table must have exactly one column when viewed as array'
            )

        return ops.TableArrayView(self).to_expr()
Exemple #2
0
def _table_to_array(self):
    """
    Single column tables can be viewed as arrays.
    """
    op = _ops.TableArrayView(self)
    return op.to_expr()