-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
63355: opt: fix duplicate empty JSON value spans for <@ expressions r=angelazxu a=angelazxu Previously, there were some duplicate spans produced for empty JSON values, such as {"a": []} and {"a": {}}. This was discovered in the spans produced from contained by and fetch/contained by expressions. This commit fixes this issue, only allowing one empty object or array span to be created per level of nesting, in encodedContainedInvertedIndexSpans. Informs: #61430 Release note: None 63371: colexec: miscellaneous cleanup r=yuzefovich a=yuzefovich **colexec: clean up external distinct test a bit** Release note: None **colbuilder: enforce unique memory monitor names** Our disk-spilling infrastructure (namely, `diskSpillerBase`) uses the name of the limited memory monitor of its in-memory operator in order to distinguish the "memory budget exceeded" errors between the ones it needs to catch and the ones it needs to propagate further. In particular, previously it was possible that the in-memory chains within two disk-backed sorters created for the external distinct (one in the fallback strategy and another when the output ordering is needed, on top of the external distinct) would have the same memory monitor names. This is now fixed by appending a unique suffix to all names and is enforced via an invariants assertion in the test setup. Note that even with the previous behavior no actual bug would occur because the monitors with the same name were on "different levels of the tree" and there was the correct catcher in-between. So this commit simply restores the assumption that we had implicitly without fixing any production bugs. Release note: None 63372: colexec: fix hash aggregator when spilling to disk r=yuzefovich a=yuzefovich **execinfrapb: introduce aliases for agg funcs and use everywhere** This commit introduces nicer aliases for the specification of the aggregate functions and uses the aliases throughout the code base. Release note: None **colexec: clean up aggregator test cases** This commit is only a test change. It cleans up the aggregator test cases in the following ways: - removing some of the defaults in favor of explicit setting (easier to read each test case in isolation) - reordering the fields to have uniform assignment order - inserting any_not_null aggregates for the cases when the input is ordered (this will be needed by the follow up commit that will enforce a particular order on the output). This change simulates how specs are created in the production. - removing a couple of impossible in production test cases (when some columns are unused). Release note: None **colexec: fix hash aggregator when spilling to disk** In some cases the aggregation is expected to maintain the required ordering in order to eliminate an explicit sort afterwards. It is always the case that the required ordering is a prefix of ordered grouping columns. With the introduction of disk spilling for the vectorized hash aggregator in 21.1 release the ordering was no longer maintained if the spilling occurs. In all previous cases (row-by-row processors and in-memory columnar operator) the ordering was maintained by construction, but with `hashBasedPartitioner` the ordering can be arbitrary. In order to fix this issue we now do what we did for the external distinct - we plan an external sort on top of the external hash aggregator to restore the required ordering. Note that this will only kick in if the spilling to disk occurred. This required changes to the AggregatorSpec to propagate the required output ordering. Fixes: #63159. Release note (bug fix): In 21.1 alpha and beta releases CockroachDB could return the output in an incorrect order if the query containing hash aggregation was executed via the vectorized engine and spilling to temporary storage was required, in some cases. Co-authored-by: Angela Xu <[email protected]> Co-authored-by: Yahor Yuzefovich <[email protected]>
- Loading branch information
Showing
33 changed files
with
1,173 additions
and
947 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.