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

Julian Hyde commented on CALCITE-4661:
--------------------------------------

Why does PostgreSQL require the values of {{MODE}} to be sorted? I understand 
why {{PERCENTILE_CONT}} etc. require sorting. But one should be able to apply 
{{MODE}} to a [categorical 
variable|https://en.wikipedia.org/wiki/Categorical_variable] such as a person's 
blood type (A, AB, or O), which is not inherently ordered.

Do other databases require sorting? Should Calcite require sorting?

> Add MODE aggregate functions
> ----------------------------
>
>                 Key: CALCITE-4661
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4661
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: duan xiong
>            Assignee: duan xiong
>            Priority: Major
>
> Add MODE functions in the operator table which returns the most frequent 
> input value (arbitrarily choosing the first one if there are multiple 
> equally-frequent results)



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

Reply via email to