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

[fix](order by) fix bug of order by desc when rowsets is no overlapping #18100

Merged
merged 3 commits into from
Mar 28, 2023

Conversation

jacktengg
Copy link
Contributor

Proposed changes

Issue Number: close #xxx

Problem summary

In the case of rowets non-overlap and desc sorting, the logic of VCollectIterator::Level0Iterator::init_for_union will be followed. In this function, the row ref pos of the first level0 iterator is set to 0, and the row pos of other level0 iterators are all Set to -1.

But in the level1iterator, when rowets are non-overlapping and is ordering by desc, the list of rowset iterators will be reversed, causing the row ref pos of the first level0 iterator in the list to be -1, causing the block reader to think that the entire tablet has no data.

Checklist(Required)

  • Does it affect the original behavior
  • Has unit tests been added
  • Has document been added or modified
  • Does it need to update dependencies
  • Is this PR support rollback (If NO, please explain WHY)

Further comments

If this is a relatively large or complex change, kick off the discussion at [email protected] by explaining why you chose the solution you did and what alternatives you considered, etc...

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@yiguolei yiguolei added usercase Important user case type label dev/1.2.4 labels Mar 24, 2023
@yiguolei
Copy link
Contributor

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@jacktengg
Copy link
Contributor Author

run buildall

1 similar comment
@jacktengg
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

) ENGINE=OLAP
AGGREGATE KEY(`time_period`, `area_name`, `province`, `res_name`, `dev`)
DISTRIBUTED BY HASH(`time_period`, `area_name`, `province`, `res_name`, `dev`) BUCKETS 4
PROPERTIES (
Copy link
Contributor

Choose a reason for hiding this comment

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

add disable compaction;

remove distributed by

yixiutt
yixiutt previously approved these changes Mar 27, 2023
@yixiutt
Copy link
Contributor

yixiutt commented Mar 27, 2023

LGTM

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@jacktengg
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

@yiguolei yiguolei left a comment

Choose a reason for hiding this comment

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

LGTM

@yiguolei
Copy link
Contributor

run buidlall

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Mar 27, 2023
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@yiguolei yiguolei merged commit c95b81f into apache:master Mar 28, 2023
yagagagaga added a commit to yagagagaga/doris that referenced this pull request Mar 28, 2023
morningman pushed a commit that referenced this pull request Mar 28, 2023
…ng (#18100)

In the case of rowets non-overlap and desc sorting, the logic of VCollectIterator::Level0Iterator::init_for_union will be followed. In this function, the row ref pos of the first level0 iterator is set to 0, and the row pos of other level0 iterators are all Set to -1.

But in the level1iterator, when rowets are non-overlapping and is ordering by desc, the list of rowset iterators will be reversed, causing the row ref pos of the first level0 iterator in the list to be -1, causing the block reader to think that the entire tablet has no data.
@yagagagaga yagagagaga mentioned this pull request Mar 31, 2023
5 tasks
gnehil pushed a commit to gnehil/doris that referenced this pull request Apr 21, 2023
…ng (apache#18100)

In the case of rowets non-overlap and desc sorting, the logic of VCollectIterator::Level0Iterator::init_for_union will be followed. In this function, the row ref pos of the first level0 iterator is set to 0, and the row pos of other level0 iterators are all Set to -1.

But in the level1iterator, when rowets are non-overlapping and is ordering by desc, the list of rowset iterators will be reversed, causing the row ref pos of the first level0 iterator in the list to be -1, causing the block reader to think that the entire tablet has no data.
mongo360 pushed a commit to mongo360/doris that referenced this pull request Jul 12, 2023
…ng (apache#18100)

In the case of rowets non-overlap and desc sorting, the logic of VCollectIterator::Level0Iterator::init_for_union will be followed. In this function, the row ref pos of the first level0 iterator is set to 0, and the row pos of other level0 iterators are all Set to -1.

But in the level1iterator, when rowets are non-overlapping and is ordering by desc, the list of rowset iterators will be reversed, causing the row ref pos of the first level0 iterator in the list to be -1, causing the block reader to think that the entire tablet has no data.
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/vectorization dev/1.2.4-merged kind/test reviewed usercase Important user case type label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants