[ 
https://issues.apache.org/jira/browse/BEAM-11696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kyle Weaver updated BEAM-11696:
-------------------------------
    Description: 
Reference: 
[https://github.com/google/zetasql/blob/master/docs/functions-and-operators.md#logical_and]

Performs a logical AND operation on expression and returns the result.

Supported Argument Types: BOOL
 Returned Data Types: BOOL

Example:

 
{code:java}
SELECT LOGICAL_AND(x) AS logical_and FROM UNNEST([null, null, null]) AS x;

+-------------+
| logical_and |
+-------------+
| false       |
+-------------+
{code}
 

Problems: 

After implementation, there is a problem:
 * When input contains all null values:

{code:sql}
SELECT LOGICAL_AND(a) AS logical_and FROM UNNEST([null, null, null]) AS a;
{code}

the output is:

{code:java}
No matching signature for aggregate function LOGICAL_AND for argument types: 
INT64. Supported signature: LOGICAL_AND(BOOL)  {code}
         which is same behavior as of BigQuery console. Though, it should 
return null.

How to test: unit tests

 

  was:
Reference: 
[https://github.com/google/zetasql/blob/master/docs/functions-and-operators.md#logical_and]

Performs a logical AND operation on expression and returns the result.

Supported Argument Types: BOOL
 Returned Data Types: BOOL

Example:

 
{code:java}
SELECT LOGICAL_AND(x) AS logical_and FROM UNNEST([null, null, null]) AS x;

+-------------+
| logical_and |
+-------------+
| false       |
+-------------+
{code}
 

Problems: 

After implementation, there is a problem:
 * When input contains all null values, the output is:

{code:java}
No matching signature for aggregate function LOGICAL_AND for argument types: 
INT64. Supported signature: LOGICAL_AND(BOOL)  {code}
         which is same behavior as of BigQuery console. Though, it should 
return null.

How to test: unit tests

 


> NULL values don't work correctly when implementing LOGICAL_AND aggregation 
> function in ZetaSQL
> ----------------------------------------------------------------------------------------------
>
>                 Key: BEAM-11696
>                 URL: https://issues.apache.org/jira/browse/BEAM-11696
>             Project: Beam
>          Issue Type: Bug
>          Components: dsl-sql-zetasql
>            Reporter: Sonam Ramchand
>            Assignee: Kyle Weaver
>            Priority: P3
>             Fix For: Not applicable
>
>
> Reference: 
> [https://github.com/google/zetasql/blob/master/docs/functions-and-operators.md#logical_and]
> Performs a logical AND operation on expression and returns the result.
> Supported Argument Types: BOOL
>  Returned Data Types: BOOL
> Example:
>  
> {code:java}
> SELECT LOGICAL_AND(x) AS logical_and FROM UNNEST([null, null, null]) AS x;
> +-------------+
> | logical_and |
> +-------------+
> | false       |
> +-------------+
> {code}
>  
> Problems: 
> After implementation, there is a problem:
>  * When input contains all null values:
> {code:sql}
> SELECT LOGICAL_AND(a) AS logical_and FROM UNNEST([null, null, null]) AS a;
> {code}
> the output is:
> {code:java}
> No matching signature for aggregate function LOGICAL_AND for argument types: 
> INT64. Supported signature: LOGICAL_AND(BOOL)  {code}
>          which is same behavior as of BigQuery console. Though, it should 
> return null.
> How to test: unit tests
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to