lide-reed opened a new issue, #18429: URL: https://github.com/apache/doris/issues/18429
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues. ### Version 下面这个版本有错误: commit 2b69335c12b794fa9d2b81c797443066c5bd1723 Author: siriume <siri...@gmail.com> Date: Fri Mar 31 09:07:02 2023 +0800 [chore](build) Build java udf by default (#18254) 下面这个版本没问题: commit de2bc98fa26d30136b9864275e184d28ae72e96b Author: morningman <morning...@163.com> Date: Thu Mar 16 17:48:24 2023 +0800 [bugfix](compaction) remove useless check #17804 cherry-pick #17804 ### What's Wrong? CREATE TABLE `mytable` ( `c1` varchar(255) NULL COMMENT '', `c2` varchar(10) NOT NULL COMMENT '', `c3` varchar(10) NULL COMMENT '', `c4` varchar(10) NULL COMMENT '', `c5` varchar(255) NULL COMMENT '', `c6` bigint(20) NULL COMMENT '', `c7` bigint(20) NULL COMMENT '' ) ENGINE=OLAP UNIQUE KEY(`c1`, `c2`, `c3`, `c4`) DISTRIBUTED BY HASH(`c2`, `c4`) BUCKETS 3; SELECT t1.*, row_number() OVER(PARTITION BY c4,c5,diff ORDER BY c2 DESC) AS row_num_1, row_number() OVER(PARTITION BY c4,c5 ORDER BY c2 DESC) AS row_num_2 FROM (SELECT c4, c5, c2, CASE WHEN c6>c7 THEN 1 WHEN c6<c7 THEN -1 ELSE 0 END AS diff FROM mytable)t1; MySQL [testdb]> SELECT t1.*, -> row_number() OVER(PARTITION BY c4,c5,diff ORDER BY c2 DESC) AS row_num_1, -> row_number() OVER(PARTITION BY c4,c5 ORDER BY c2 DESC) AS row_num_2 -> FROM -> (SELECT c4, c5, c2, -> CASE WHEN c6>c7 THEN 1 -> WHEN c6<c7 THEN -1 -> ELSE 0 -> END AS diff -> FROM mytable)t1; ERROR 1105 (HY000): errCode = 2, detailMessage = Unexpected exception: null ### What You Expected? execute right ### How to Reproduce? CREATE TABLE `mytable` ( `c1` varchar(255) NULL COMMENT '', `c2` varchar(10) NOT NULL COMMENT '', `c3` varchar(10) NULL COMMENT '', `c4` varchar(10) NULL COMMENT '', `c5` varchar(255) NULL COMMENT '', `c6` bigint(20) NULL COMMENT '', `c7` bigint(20) NULL COMMENT '' ) ENGINE=OLAP UNIQUE KEY(`c1`, `c2`, `c3`, `c4`) DISTRIBUTED BY HASH(`c2`, `c4`) BUCKETS 3; SELECT t1.*, row_number() OVER(PARTITION BY c4,c5,diff ORDER BY c2 DESC) AS row_num_1, row_number() OVER(PARTITION BY c4,c5 ORDER BY c2 DESC) AS row_num_2 FROM (SELECT c4, c5, c2, CASE WHEN c6>c7 THEN 1 WHEN c6<c7 THEN -1 ELSE 0 END AS diff FROM mytable)t1; ### Anything Else? _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org