druid icon indicating copy to clipboard operation
druid copied to clipboard

Min() and Max() aggregate functions on string columns

Open johnImply opened this issue 1 year ago • 3 comments

Description

Provide min() and max() aggregrate functions on string expressions

This is related to https://github.com/apache/druid/issues/11659 but here I am calling out explicit behavior desired.

Motivation

Many database products extend min() and max() aggregate functions to string datatypes, primary based on a lexical sort.

Assumed this would follow the same sorting mechanism as provided by the ORDER BY clause.

johnImply avatar Aug 24 '24 17:08 johnImply

Hello, I plan to give a shot at this.

I am referencing the other MinAggregator classes, and am now figuring out what the BufferAggregator and AggregatorFactory are for. While I am confident that I will be able to get somewhere in this, any tips from any experienced developers will be welcome, and will definitely speed up my learning process. 😄

GWphua avatar Sep 12 '24 02:09 GWphua

You can refer to the javadocs of these interfaces to get an idea behind these classes. AggregatorFactory is what you use to get a off-heap aggregator or an on-heap aggregator or a vector aggregator (off-heap). Depending on the use case (ingestion vs query), query engine (topn, grouping), one of on-heap or off-heap aggregator can be used.

When you are building a new kind of aggregation, you will be making all these flavours available so that your aggregation can work in various different settings.

abhishekagarwal87 avatar Sep 12 '24 08:09 abhishekagarwal87

This issue has been marked as stale due to 280 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the [email protected] list. Thank you for your contributions.

github-actions[bot] avatar Jun 20 '25 00:06 github-actions[bot]

This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.

github-actions[bot] avatar Jul 18 '25 00:07 github-actions[bot]