[
https://issues.apache.org/jira/browse/CALCITE-4661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17379392#comment-17379392
]
Julian Hyde commented on CALCITE-4661:
--------------------------------------
Looks better. A couple of things:
* I don't think you need {{ReturnTypes.MODE}}. I think you can use
{{ReturnTypes.ARG0_NULLABLE_IF_EMPTY}}, which is what MIN uses.
* In {{reference.md}}, sort the table of aggregate functions into alphabetical
order.
The code generated by {{class ModeImplementor}} looks fine. In future we could
consider using a Histogram class: one data structure could power {{MODE}},
{{MEDIAN}}, {{PERCENTILE_DISC}}, {{RANK}} etc. But we don't need to do that now.
> Add MODE aggregate function
> ---------------------------
>
> 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
> Labels: pull-request-available
> Fix For: 1.28.0
>
> Time Spent: 2h 20m
> Remaining Estimate: 0h
>
> 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)