Skip to content

branch-2.1: [Bug](sort) fix wrong result coz push down sort with null last #51472 #51507

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

Merged
merged 1 commit into from
Jun 16, 2025

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jun 5, 2025

Cherry-picked from #51472

@github-actions github-actions bot requested a review from yiguolei as a code owner June 5, 2025 02:30
@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring closed this Jun 5, 2025
@dataroaring dataroaring reopened this Jun 5, 2025
@hello-stephen
Copy link
Contributor

run buildall

### What problem does this PR solve?
```sql
drop table if exists d_table;

create table d_table (
	k1 int null,
	k2 int not null,
	k3 bigint null,
    k4 varchar(100) null
)
duplicate key (k1,k2,k3)
distributed BY hash(k1) buckets 3
properties("replication_num" = "1");


insert into d_table select 1,1,1,'a';
insert into d_table select 2,2,2,'b';
insert into d_table select 3,-3,null,'c';
insert into d_table select 3,3,null,'c';
insert into d_table select null,3,null,'c';

select * from d_table order by k1 nulls last limit 1;

mysql> select * from d_table order by k1 nulls last limit 1;
+------+------+------+------+
| k1   | k2   | k3   | k4   |
+------+------+------+------+
|    2 |    2 |    2 | b    |
+------+------+------+------+
1 row in set (0.01 sec)

mysql> select * from d_table order by k1 nulls last limit 2;
+------+------+------+------+
| k1   | k2   | k3   | k4   |
+------+------+------+------+
|    1 |    1 |    1 | a    |
|    2 |    2 |    2 | b    |
+------+------+------+------+
2 rows in set (0.02 sec)
```
@yiguolei yiguolei force-pushed the auto-pick-51472-branch-2.1 branch from b30856b to 7768c8d Compare June 7, 2025 12:46
@yiguolei
Copy link
Contributor

yiguolei commented Jun 7, 2025

run buildall

@yiguolei yiguolei merged commit c9623c3 into branch-2.1 Jun 16, 2025
21 of 24 checks passed
@github-actions github-actions bot deleted the auto-pick-51472-branch-2.1 branch June 16, 2025 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants