Order by expression failed to execute in mysql plugin
- Dominant language
- Java
- Stars
- 2k
- Forks
- 990
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 5
Description
Order by expression failed to execute in mysql plugin
Steps to reproduce the behavior:
1. The version information is as follows:
```
apache drill> select commit_message, commit_time from sys.version;
+----------------------------------------------------------------------------------+---------------------------+
| commit_message | commit_time |
+----------------------------------------------------------------------------------+---------------------------+
| DRILL-8314: Add support for automatically retrying and disabling broken storage plugins (https://github.com/apache/drill/pull/2655) | 18.10.2022 @ 18:15:31 CST |
```
2. Create tables in mysql database.
```sql
CREATE TABLE orders( O_ORDERKEY INTEGER NOT NULL,
O_CUSTKEY INTEGER NOT NULL,
O_ORDERSTATUS CHAR(1) NOT NULL,
O_TOTALPRICE DECIMAL(15,2) NOT NULL,
O_ORDERDATE DATE NOT NULL,
O_ORDERPRIORITY CHAR(15) NOT NULL,
O_CLERK CHAR(15) NOT NULL,
O_SHIPPRIORITY INTEGER NOT NULL,
O_COMMENT VARCHAR(79) NOT NULL);
```
3. Create mysql Plugins in Storage label via http://localhost:8047/storage pages
4. The sql statement is executed as follows
```sql
select
extract(year from o_orderdate) as o_year
from orders
group by o_year
order by o_year;
```
```
apache drill (mysql.test)> select
2...............semicolon> extract(year from o_orderdate) as o_year
3...............semicolon> from orders
4...............semicolon> group by o_year
5...............semicolon> order by o_year;
Error: DATA_READ ERROR: The JDBC storage plugin failed while trying setup the SQL query.
Sql: SELECT EXTRACT(YEAR FROM `O_ORDERDATE`) AS `o_year`
FROM `test`.`orders`
GROUP BY EXTRACT(YEAR FROM `O_ORDERDATE`)
ORDER BY EXTRACT(YEAR FROM `O_ORDERDATE`) IS NULL, EXTRACT(YEAR FROM `O_ORDERDATE`)
Fragment: 0:0
[Error Id: 43ba28d2-169f-4940-ab9c-5a1fa52de994 on DESKTOP-PHHB7LC:31010] (state=,code=0)
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.