snowflake.snowpark.functions.booland¶
- snowflake.snowpark.functions.booland(expr1: Union[snowflake.snowpark.column.Column, str], expr2: Union[snowflake.snowpark.column.Column, str]) Column [source]¶
- Computes the Boolean AND of two numeric expressions. In accordance with Boolean semantics:
Non-zero values (including negative numbers) are regarded as True.
Zero values are regarded as False.
- Parameters:
expr1 (ColumnOrName) – The first boolean expression.
expr2 (ColumnOrName) – The second boolean expression.
- Returns:
True if both expressions are non-zero.
False if both expressions are zero or one expression is zero and the other expression is non-zero or NULL.
NULL if both expressions are NULL or one expression is NULL and the other expression is non-zero.
- Example::
>>> from snowflake.snowpark.functions import col >>> df = session.create_dataframe([[1, -2], [0, 2], [0, 0], [5, 3]], schema=["a", "b"]) >>> df.select(booland(col("a"), col("b")).alias("result")).collect() [Row(RESULT=True), Row(RESULT=False), Row(RESULT=False), Row(RESULT=True)]