Skip to content

Commit

Permalink
test: add test for sorts inside aggregate functions
Browse files Browse the repository at this point in the history
  • Loading branch information
gabotechs committed Jul 4, 2024
1 parent 48b75e1 commit 61a61ca
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ private void assertAggregateRoundtrip(Expression.AggregationInvocation invocatio
.initialSchema(NamedStruct.of(Arrays.asList("decimal"), R.struct(R.decimal(10, 2))))
.addRows(literal)
.build();
var sort =
ImmutableExpression.SortField.builder()
.expr(ExpressionCreator.bool(true, true))
.direction(Expression.SortDirection.DESC_NULLS_LAST)
.build();
ExtensionCollector functionCollector = new ExtensionCollector();
var to = new RelProtoConverter(functionCollector);
var extensions = defaultExtensionCollection;
Expand All @@ -45,6 +50,7 @@ private void assertAggregateRoundtrip(Expression.AggregationInvocation invocatio
.declaration(extensions.aggregateFunctions().get(0))
.outputType(TypeCreator.of(false).I64)
.aggregationPhase(Expression.AggregationPhase.INITIAL_TO_RESULT)
.sort(Arrays.asList(sort))
.invocation(invocation)
.build())
.build();
Expand Down

0 comments on commit 61a61ca

Please sign in to comment.