[MCOL-3485] ORDER BY no longer working in some queries Created: 2019-09-06 Updated: 2020-03-26 Resolved: 2020-03-26 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | ? |
| Affects Version/s: | 1.2.5 |
| Fix Version/s: | 1.4.4 |
| Type: | Bug | Priority: | Critical |
| Reporter: | antoine | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
debian 9 |
||
| Sprint: | 2020-3, 2020-4, 2020-5 |
| Description |
|
bug not present in 1.1.7 and definitely present in 1.2.5 order by is not correctly processed for trivial queries let's say we want to compute sales for region 'x' and 'y', for each of 3 business units 1,2 and 3 like this:
when applying an order by clause, 'order by bu' or 'order by x' work but 'order by y' is ignored
|
| Comments |
| Comment by Roman [ 2019-12-04 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It looks like a bug in our fork code.
Another is to use CS internal sorting wrapping the original query into a subquery if it is possible:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jose Rojas (Inactive) [ 2020-02-27 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I have submitted a patch for 1.4.4. The patch for 1.4 does not fix 1.2, probably related to what Roman said previously. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2020-03-25 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Build verified: 1.4.4-1 source /root/ColumnStore/buildColumnstoreFromGithubSource/server Revert "make columnstore maturity gamma" This reverts commit e4a0372cd08a53f97a62d6b6ef32114b553cacb7. /root/ColumnStore/buildColumnstoreFromGithubSource/server/engine Merge pull request #1113 from pleblanc1976/develop-1.4 Bumped version num to 1.4.4-1 Reproduced the issue in 1.2.5-1 and verified fix in 1.4.4-1 MariaDB [mytest]> select
-----
----- MariaDB [mytest]> select
-----
----- MariaDB [mytest]> select a as bu, sum(case when b='x' then c else null end) as 'x', sum(case when b='y' then c else null end) as 'y' from t group by bu order by y desc;
-----
----- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roman [ 2020-03-26 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
develop-1.4 should be tested having column x in mind, whilst develop-1.2 had issues with sorting over column y. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2020-03-26 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Build verified: 1.4.4-1 source /root/ColumnStore/buildColumnstoreFromGithubSource/server /root/ColumnStore/buildColumnstoreFromGithubSource/server/engine Merge pull request #1117 from drrtuy/ Verified both x and y columns, asc and desc. MariaDB [mytest]> create table t(a int, b varchar(10), c decimal(7,2)) engine=columnstore; MariaDB [mytest]> insert into t(a,b,c) values MariaDB [mytest]> select
-----
----- MariaDB [mytest]> select
-----
----- MariaDB [mytest]> select a as bu, sum(case when b='x' then c else null end) as 'x', sum(case when b='y' then c else null end) as 'y' from t group by bu order by y desc;
-----
----- MariaDB [mytest]> select a as bu, sum(case when b='x' then c else null end) as 'x', sum(case when b='y' then c else null end) as 'y' from t group by bu order by x asc;
-----
----- MariaDB [mytest]> select a as bu, sum(case when b='x' then c else null end) as 'x', sum(case when b='y' then c else null end) as 'y' from t group by bu order by x desc;
-----
----- |