Skip to content

[Bug-fix] Update correct data partition of fragment which contains Repeat Node#5910

Merged
morningman merged 1 commit intoapache:masterfrom
EmmyMiao87:colocate_agg_bug
May 27, 2021
Merged

[Bug-fix] Update correct data partition of fragment which contains Repeat Node#5910
morningman merged 1 commit intoapache:masterfrom
EmmyMiao87:colocate_agg_bug

Conversation

@EmmyMiao87
Copy link
Contributor

@EmmyMiao87 EmmyMiao87 commented May 26, 2021

Proposed changes

The Repeat Node will change the data partition of fragment
when the origin data partition of fragment is HashPartition.
The Repeat Node will generate some new rows.
The distribution of these new rows is completely inconsistent with the original data distribution,
their distribution is RANDOM.

If the data distribution is not corrected,
an error will occur when the agg node determines whether to perform colocate.
Wrong data distribution will cause the agg node to think that agg can be colocated,
leading to wrong results.
For example, the following query can not be colocated although the distributed column of table is k1:

SELECT k1, k2, SUM( k3 )
FROM table
GROUP BY GROUPING SETS ( (k1, k2), (k1), (k2), ( ) )

Types of changes

What types of changes does your code introduce to Doris?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)
  • Code refactor (Modify the code structure, format the code, etc...)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have created an issue on (Fix Error result of Grouping set when colocate is enable #5909) and described the bug/feature there in detail
  • Compiling and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • If these changes need document changes, I have updated the document
  • Any dependent changes have been merged

…peat Node

The Repeat Node will change the data partition of fragment
  when the origin data partition of fragment is HashPartition.
The Repeat Node will generate some new rows.
The distribution of these new rows is completely inconsistent with the original data distribution,
  their distribution is RANDOM.

If the data distribution is not corrected,
  an error will occur when the agg node determines whether to perform colocate.
Wrong data distribution will cause the agg node to think that agg can be colocated,
  leading to wrong results.
For example, the following query can not be colocated although the distributed column of table is k1:
```
SELECT k1, k2, SUM( k3 )
FROM tabale
GROUP BY GROUPING SETS ( (k1, k2), (k1), (k2), ( ) )
```
@EmmyMiao87 EmmyMiao87 added area/colocated Issues or PRs related to colocated tables kind/fix Categorizes issue or PR as related to a bug. area/planner Issues or PRs related to the query planner labels May 26, 2021
Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@morningman morningman added the approved Indicates a PR has been approved by one committer. label May 26, 2021
@morningman morningman merged commit aa17d40 into apache:master May 27, 2021
stdpain pushed a commit to stdpain/incubator-doris that referenced this pull request Jul 8, 2021
…peat Node (apache#5910)

The Repeat Node will change the data partition of fragment
  when the origin data partition of fragment is HashPartition.
The Repeat Node will generate some new rows.
The distribution of these new rows is completely inconsistent with the original data distribution,
  their distribution is RANDOM.

If the data distribution is not corrected,
  an error will occur when the agg node determines whether to perform colocate.
Wrong data distribution will cause the agg node to think that agg can be colocated,
  leading to wrong results.
For example, the following query can not be colocated although the distributed column of table is k1:
```
SELECT k1, k2, SUM( k3 )
FROM table
GROUP BY GROUPING SETS ( (k1, k2), (k1), (k2), ( ) )
```
pingchunzhang added a commit to pingchunzhang/doris that referenced this pull request Dec 5, 2025
Hastyshell pushed a commit to Hastyshell/doris that referenced this pull request Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. area/colocated Issues or PRs related to colocated tables area/planner Issues or PRs related to the query planner kind/fix Categorizes issue or PR as related to a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error result of Grouping set when colocate is enable

2 participants