You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Feng Zhu (Jira)" <ji...@apache.org> on 2020/02/24 06:02:00 UTC
[jira] [Comment Edited] (CALCITE-3815) Add missing SQL standard
aggregate functions: EVERY, SOME, INTERSECTION
[ https://issues.apache.org/jira/browse/CALCITE-3815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17043166#comment-17043166 ]
Feng Zhu edited comment on CALCITE-3815 at 2/24/20 6:01 AM:
------------------------------------------------------------
It seems like Intersect/Fusion (including codegen) has already been implemented in CALCITE-2355.
was (Author: donnyzone):
It seems like Except/Fusion (including codegen) has already been implemented in CALCITE-2355.
> 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
> Priority: Major
>
> 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)