Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

colexec: fix usage of incorrect type schema for external hash agg #63446

Merged
merged 1 commit into from
Apr 11, 2021
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
2 changes: 1 addition & 1 deletion pkg/sql/colexec/external_hash_aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func NewExternalHashAggregator(
// sort isn't accounted for when considering the number file descriptors to
// acquire. Not urgent, but it should be fixed.
maxNumberActivePartitions := calculateMaxNumberActivePartitions(flowCtx, args, ehaNumRequiredActivePartitions)
return createDiskBackedSorter(eha, args.Spec.ResultTypes, outputOrdering.Columns, maxNumberActivePartitions)
return createDiskBackedSorter(eha, newAggArgs.OutputTypes, outputOrdering.Columns, maxNumberActivePartitions)
}

// HashAggregationDiskSpillingEnabled is a cluster setting that allows to
Expand Down
6 changes: 6 additions & 0 deletions pkg/sql/logictest/testdata/logic_test/aggregate
Original file line number Diff line number Diff line change
Expand Up @@ -3840,3 +3840,9 @@ SELECT a, b, count(*) FROM t63159 GROUP BY a,b ORDER BY a
2 2 1
3 3 1
5 5 1

# Regression test for the vectorized hash aggregator using incorrect type schema
# when planning an external sort to maintain the required ordering.
statement ok
CREATE TABLE t63436 (a INT, b FLOAT, c DECIMAL, INDEX(a));
SELECT count(*) FROM t63436@t63436_a_idx GROUP BY b, c ORDER BY c;