[ 
https://issues.apache.org/jira/browse/CALCITE-6225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17811057#comment-17811057
 ] 

Julian Hyde commented on CALCITE-6225:
--------------------------------------

This case (and fix) is too BigQuery-centric. LOGICAL_AND is (if you read 
SqlLibraryOperators) BigQuery's version of standard EVERY.

Let's aim to make BOOLEAN min and max translate from every dialect to every 
dialect.

> Unparse LOGICAL_AND/OR as MIN/MAX for Snowflake
> -----------------------------------------------
>
>                 Key: CALCITE-6225
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6225
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Tanner Clary
>            Assignee: Tanner Clary
>            Priority: Major
>              Labels: pull-request-available
>
> Because Snowflake does not support BigQuery's LOGICAL_AND/OR functions, they 
> can be rewritten as MIN/MAX to achieve the same effect.
> For instance, LOGICAL_AND(users.age >  3) will return {{TRUE}} iff every age 
> is > 3. This is identical to MIN(users.age > 3), because if even one age is 
> <= 3, it will return {{FALSE}}.
> Similarly, for LOGICAL_OR(users.age > 3) will return {{TRUE}} iff there 
> exists at least one age > 3. This is identical to MAX(users.age > 3) which 
> will only return {{FALSE}} iff every age is <= 3.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to