Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go/vt/vtgate/engine/ordered_aggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,9 @@ func (oa *OrderedAggregate) createEmptyRow() ([]sqltypes.Value, error) {
func createEmptyValueFor(opcode AggregateOpcode) (sqltypes.Value, error) {
switch opcode {
case AggregateCountDistinct:
return sqltypes.NULL, nil
return countZero, nil
case AggregateSumDistinct:
return sumZero, nil
return sqltypes.NULL, nil
}
return sqltypes.NULL, vterrors.Errorf(vtrpc.Code_INVALID_ARGUMENT, "unknown aggregation %v", opcode)
}
2 changes: 1 addition & 1 deletion go/vt/vtgate/engine/ordered_aggregate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ func TestNoInputAndNoGroupingKeys(t *testing.T) {
"count(distinct col2)|sum(distinct col2)",
"int64|decimal",
),
"null|0",
"0|null",
)
assert.Equal(wantResult, result)
}