test: enforce distribution is no longer inserting the coalesce#14949
Closed
wiedld wants to merge 1 commit intoapache:mainfrom
Closed
test: enforce distribution is no longer inserting the coalesce#14949wiedld wants to merge 1 commit intoapache:mainfrom
wiedld wants to merge 1 commit intoapache:mainfrom
Conversation
wiedld
commented
Feb 28, 2025
Comment on lines
+3316
to
+3342
| /// Same starting plan as [`repartitions_for_aggregate_after_sorted_union`], but adds a projection | ||
| /// between the union and aggregate. This change the outcome: | ||
| /// | ||
| /// * we no longer get repartitioning, and instead get coalescing. | ||
| #[test] | ||
| fn coalesces_for_aggregate_after_sorted_union_projection() { | ||
| let plan = aggregate_over_sorted_union_projection(vec![parquet_exec_with_stats(); 2]); | ||
|
|
||
| // Starting: has expected distribution error | ||
| let err = "does not satisfy distribution requirements: SinglePartition. Child-0 output partitioning: UnknownPartitioning(2)"; | ||
| assert_sanity_check_err(&plan, err); | ||
|
|
||
| // Outcome: | ||
| // * adds an SPM->Repartition before the first aggregation stage. | ||
| // * adds a Repartition->Sort before the second aggregation stage. | ||
| let expected_after_first_run = &[ | ||
| "AggregateExec: mode=FinalPartitioned, gby=[a1@0 as a1], aggr=[], ordering_mode=Sorted", | ||
| " SortExec: expr=[a1@0 ASC NULLS LAST], preserve_partitioning=[true]", | ||
| " RepartitionExec: partitioning=Hash([a1@0], 10), input_partitions=10", | ||
| " AggregateExec: mode=Partial, gby=[a@0 as a1], aggr=[], ordering_mode=Sorted", | ||
| " RepartitionExec: partitioning=RoundRobinBatch(10), input_partitions=1", | ||
| " SortPreservingMergeExec: [a@0 ASC]", | ||
| " SortExec: expr=[a@0 ASC], preserve_partitioning=[true]", | ||
| " ProjectionExec: expr=[a@0 as a, b@1 as value]", | ||
| " UnionExec", | ||
| " DataSourceExec: file_groups={1 group: [[x]]}, projection=[a, b, c, d, e], file_type=parquet", | ||
| " DataSourceExec: file_groups={1 group: [[x]]}, projection=[a, b, c, d, e], file_type=parquet", |
Contributor
Author
There was a problem hiding this comment.
This no longer inserts the coalesce.
Contributor
Author
|
Example WIP only. |
This was referenced Feb 28, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In a previous reproducer, I showed how the enforce distribution was inserting the coalesce.
See here: influxdata#58 (comment)
On the latest main, we no longer have the coalesce being inserted. This WIP demonstrates that the original bug no longer exists.