16601746291 opened a new issue, #19292: URL: https://github.com/apache/doris/issues/19292
### 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 Doris 1.2.4.1 ### What's Wrong? When i testing last_value function , the test table like below: mysql> desc test.group_concat_test; +-----------------+-------------+------+-------+---------+---------+ | Field | Type | Null | Key | Default | Extra | +-----------------+-------------+------+-------+---------+---------+ | user_id | LARGEINT | No | true | NULL | | | username | VARCHAR(50) | No | true | NULL | | | city | VARCHAR(20) | Yes | false | NULL | REPLACE | | age | SMALLINT | Yes | false | NULL | REPLACE | | register_source | VARCHAR(20) | Yes | false | NULL | REPLACE | | register_time | DATETIME | Yes | false | NULL | REPLACE | +-----------------+-------------+------+-------+---------+---------+ 6 rows in set (0.00 sec) mysql> select user_id -> ,username -> ,city -> ,age -> ,register_source -> ,register_time -> ,FIRST_VALUE(username) over(partition by city order by register_time) as FIRST_VALUE -> ,LAST_VALUE(username) over(partition by city order by register_time) as LAST_VALUE -> from test.group_concat_test; +---------+----------+------+------+-----------------+---------------------+-------------+------------+ | user_id | username | city | age | register_source | register_time | FIRST_VALUE | LAST_VALUE | +---------+----------+------+------+-----------------+---------------------+-------------+------------+ | 523456 | Jason | BJ | 32 | BOOKING | 2023-05-05 10:03:41 | Jason | Jason | | 123456 | sherry | CS | 31 | Wechat | 2023-04-01 10:03:41 | sherry | sherry | | 120456 | Rose | CS | 19 | Web | 2023-04-13 10:03:41 | sherry | Rose | | 13456 | Jack | HZ | 29 | Wechat | 2023-04-01 10:03:41 | Jack | Jack | | 123 | Billy | HZ | 23 | Wechat | 2023-05-05 10:03:41 | Jack | Billy | | 93456 | Yuki | SH | 31 | CTRIP | 2023-02-10 10:03:41 | Yuki | Yuki | | 2234256 | John | SH | 21 | Wechat | 2023-04-23 10:03:41 | Yuki | John | | 234 | James | SH | 20 | LOLO | 2023-05-05 10:03:41 | Yuki | James | +---------+----------+------+------+-----------------+---------------------+-------------+------------+ 8 rows in set (0.00 sec) the document description LAST_VALUE() returns the last value in the window range. Opposite of FIRST_VALUE() . But above return result LAST_VALUE() is wrong. ### What You Expected? The LAST_VALUE() returns correct, same as document description LAST_VALUE() returns the last value in the window range. Opposite of FIRST_VALUE() . ### How to Reproduce? _No response_ ### 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
