You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2019/07/01 18:27:00 UTC
[jira] [Comment Edited] (CALCITE-3159) Distinct can be removed for
MIN/MAX/BIT_OR/BIT_AND aggregate functions
[ https://issues.apache.org/jira/browse/CALCITE-3159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16876409#comment-16876409 ]
Julian Hyde edited comment on CALCITE-3159 at 7/1/19 6:26 PM:
--------------------------------------------------------------
I agree. Maybe add a method {{Optionality getDistinctOptionality()}} in {{SqlAggFunction}}, default {{OPTIONAL}}, and returning {{IGNORED}} for {{MIN}}, {{MAX}}, {{BIT_OR}}, {{BIT_AND}}. And in {{RelBuilder.aggregateCall}}, set {{distinct}} to {{false}} if the function has a value {{IGNORED}}.
was (Author: julianhyde):
I agree. Maybe add a method {{Optionality getDistinctOptionality()}} in {{SqlAggFunction}}, default {{OPTIONAL}}. , but set to {{IGNORED}} for {{MIN}}, {{MAX}}, {{BIT_OR}}, {{BIT_AND}}. And in {{RelBuilder.aggregateCall}}, set {{distinct}} to {{false}} if the function has a value {{IGNORED}}.
> Distinct can be removed for MIN/MAX/BIT_OR/BIT_AND aggregate functions
> ----------------------------------------------------------------------
>
> Key: CALCITE-3159
> URL: https://issues.apache.org/jira/browse/CALCITE-3159
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Haisheng Yuan
> Priority: Major
>
> For the following query:
> {code:java}
> select a, min(distinct b), bit_or(distinct c) from foo group by a;
> {code}
> Currently Calcite still preserve the distinct for these aggregate functions, but DISTINCT is not meaningful with MIN/MAX and is available for ISO compatibility only. We can safely remove distinct and get more optimization opportunities.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)