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

Hanumath Rao Maduri commented on CALCITE-3815:
----------------------------------------------

[~donnyzone] Thanks  for trying out in PG. I was referring to the following 
query when I mentioned null in reference.md documentation.
{code:java}
select every(a>100) from (VALUES (1, 11), (2, 22), (3, 33)) AS t (a, b) where a 
> 100
---------
null{code}
PG(9.6) also returns null as expected. I also checked in the ANSI standard, it 
also specifies the same. Once again reading the reference.md, the documentation 
which I wrote might confuse so in the next commit I am planning to remove it. I 
am also planning to add similar query in agg.iq.

> Add missing SQL standard aggregate functions: EVERY, SOME, INTERSECTION
> -----------------------------------------------------------------------
>
>                 Key: CALCITE-3815
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3815
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Hanumath Rao Maduri
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Add missing SQL standard aggregate functions: EVERY, SOME, INTERSECTION.
> Examples:
> {code}
> SELECT deptno,
>   EVERY(sal < 3000) AS es, SOME(sal < 1000) AS ss,
>   EVERY(comm < 500) AS ec, SOME(comm < 500) AS sc
> FROM emp
> GROUP BY deptno;
> +--------+-------+-------+-------+------+
> | DEPTNO |  ES   |  SS   |  EC   |  SC  |
> +--------+-------+-------+-------+------+
> | 10     | FALSE | FALSE |       |      |
> | 20     | FALSE | TRUE  |       |      |
> | 30     | TRUE  | TRUE  | FALSE | TRUE |
> +--------+-------+-------+-------+------+
> {code}
> {{EVERY}} and {{SOME}} can be implemented by translating to {{MIN}}, {{MAX}}:
> * {{EVERY(condition)}} is equivalent to {{MIN(condition)}};
> * {{SOME(condition)}} is equivalent to {{MAX(condition)}}
> where {{condition}} is a {{BOOLEAN}} expression, possibly allowing {{NULL}} 
> values).
> {{INTERSECTION}} computes the intersection of collections (arrays and 
> multisets). (Compare to {{FUSION}}, which computes the union of collections.)
> {{FUSION}} is in the operator table but there is no code-generation for it. 
> This task should implement {{FUSION}} and {{INTERSECTION}} so that we can run 
> queries in Enumerable mode.



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

Reply via email to