Skip to content

Commit

Permalink
Convert min_by/max_by N to annotated aggregate function
Browse files Browse the repository at this point in the history
  • Loading branch information
dain committed May 27, 2022
1 parent 62fecd0 commit 78bae25
Show file tree
Hide file tree
Showing 21 changed files with 848 additions and 442 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@
import io.trino.operator.aggregation.MapAggregationFunction;
import io.trino.operator.aggregation.MapUnionAggregation;
import io.trino.operator.aggregation.MaxAggregationFunction;
import io.trino.operator.aggregation.MaxByAggregationFunction;
import io.trino.operator.aggregation.MaxDataSizeForStats;
import io.trino.operator.aggregation.MergeHyperLogLogAggregation;
import io.trino.operator.aggregation.MergeQuantileDigestFunction;
import io.trino.operator.aggregation.MergeTDigestAggregation;
import io.trino.operator.aggregation.MinAggregationFunction;
import io.trino.operator.aggregation.MinByAggregationFunction;
import io.trino.operator.aggregation.QuantileDigestAggregationFunction.BigintQuantileDigestAggregationFunction;
import io.trino.operator.aggregation.QuantileDigestAggregationFunction.DoubleQuantileDigestAggregationFunction;
import io.trino.operator.aggregation.QuantileDigestAggregationFunction.RealQuantileDigestAggregationFunction;
Expand All @@ -78,10 +80,8 @@
import io.trino.operator.aggregation.VarianceAggregation;
import io.trino.operator.aggregation.histogram.Histogram;
import io.trino.operator.aggregation.listagg.ListaggAggregationFunction;
import io.trino.operator.aggregation.minmaxby.MaxByAggregationFunction;
import io.trino.operator.aggregation.minmaxby.MaxByNAggregationFunction;
import io.trino.operator.aggregation.minmaxby.MinByAggregationFunction;
import io.trino.operator.aggregation.minmaxby.MinByNAggregationFunction;
import io.trino.operator.aggregation.minmaxbyn.MaxByNAggregationFunction;
import io.trino.operator.aggregation.minmaxbyn.MinByNAggregationFunction;
import io.trino.operator.aggregation.minmaxn.MaxNAggregationFunction;
import io.trino.operator.aggregation.minmaxn.MinNAggregationFunction;
import io.trino.operator.aggregation.multimapagg.MultimapAggregationFunction;
Expand Down Expand Up @@ -544,13 +544,14 @@ public static FunctionBundle create(FeaturesConfig featuresConfig, TypeOperators
.aggregates(ChecksumAggregationFunction.class)
.aggregates(ArbitraryAggregationFunction.class)
.functions(GREATEST, LEAST)
.functions(new MaxByNAggregationFunction(blockTypeOperators), new MinByNAggregationFunction(blockTypeOperators))
.aggregates(MinAggregationFunction.class)
.aggregates(MaxAggregationFunction.class)
.aggregates(MinByAggregationFunction.class)
.aggregates(MaxByAggregationFunction.class)
.aggregates(MaxNAggregationFunction.class)
.aggregates(MinNAggregationFunction.class)
.aggregates(MinByNAggregationFunction.class)
.aggregates(MaxByNAggregationFunction.class)
.aggregates(CountColumn.class)
.functions(JSON_TO_ROW, JSON_STRING_TO_ROW, ROW_TO_ROW_CAST)
.functions(VARCHAR_CONCAT, VARBINARY_CONCAT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.operator.aggregation.minmaxby;
package io.trino.operator.aggregation;

import io.trino.operator.aggregation.NullablePosition;
import io.trino.spi.block.Block;
import io.trino.spi.block.BlockBuilder;
import io.trino.spi.function.AggregationFunction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.operator.aggregation.minmaxby;
package io.trino.operator.aggregation;

import io.trino.operator.aggregation.NullablePosition;
import io.trino.spi.block.Block;
import io.trino.spi.block.BlockBuilder;
import io.trino.spi.function.AggregationFunction;
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 78bae25

Please sign in to comment.