xlostpath opened a new issue, #28866:
URL: https://github.com/apache/doris/issues/28866

   ### 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
   
   2.0.2
   
   ### What's Wrong?
   
   Execute the following SQL, sorting by row_number:
   select
       o_time, code,
       row_number() over(partition by code order by o_time) as raw_num
   from msg;
   
   However, the incorrect result was obtained:
   o_time             |code|raw_num|
   -------------------+----+-------+
   2023-12-21 18:11:06| 100|      1|
   2023-12-21 18:11:07| 100|      2|
   2023-12-21 18:09:58| 100|      1|
   2023-12-21 18:09:59| 100|      2|
   2023-12-21 18:10:00| 100|      3|
   2023-12-21 18:10:01| 100|      4|
   2023-12-21 18:10:03| 100|      5|
   2023-12-21 18:11:08| 100|      6|
   2023-12-21 18:11:09| 100|      7|
   2023-12-21 18:11:10| 100|      8|
   2023-12-21 18:11:11| 100|      9|
   2023-12-21 18:11:13| 100|     10|
   
   ### What You Expected?
   
   The correct execution result should look like this:
   
   o_time             |code|raw_num|
   -------------------+----+-------+
   2023-12-21 18:09:58| 100|      1|
   2023-12-21 18:09:59| 100|      2|
   2023-12-21 18:10:00| 100|      3|
   2023-12-21 18:10:01| 100|      4|
   2023-12-21 18:10:03| 100|      5|
   2023-12-21 18:11:06| 100|      6|
   2023-12-21 18:11:07| 100|      7|
   2023-12-21 18:11:08| 100|      8|
   2023-12-21 18:11:09| 100|      9|
   2023-12-21 18:11:10| 100|     10|
   2023-12-21 18:11:11| 100|     11|
   2023-12-21 18:11:13| 100|     12|
   
   ### How to Reproduce?
   
   -- DDL SQL
   CREATE TABLE `msg` (
     `o_time` datetime NOT NULL,
     `code` bigint(20) NOT NULL,
     `dt` date NOT NULL
   ) ENGINE=OLAP
   DUPLICATE KEY(`occur_time`, `warn_code`)
   COMMENT 'OLAP'
   PARTITION BY RANGE(`dt`)
   (
   PARTITION p20231219 VALUES [('2023-12-19'), ('2023-12-20')),
   PARTITION p20231220 VALUES [('2023-12-20'), ('2023-12-21')),
   PARTITION p20231221 VALUES [('2023-12-21'), ('2023-12-22')),
   PARTITION p20231222 VALUES [('2023-12-22'), ('2023-12-23')),
   PARTITION p20231223 VALUES [('2023-12-23'), ('2023-12-24')),
   PARTITION p20231224 VALUES [('2023-12-24'), ('2023-12-25')),
   PARTITION p20231225 VALUES [('2023-12-25'), ('2023-12-26')))
   DISTRIBUTED BY HASH(`warn_code`) BUCKETS 1
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1",
   "is_being_synced" = "false",
   "dynamic_partition.enable" = "true",
   "dynamic_partition.time_unit" = "DAY",
   "dynamic_partition.time_zone" = "Asia/Shanghai",
   "dynamic_partition.start" = "-730",
   "dynamic_partition.end" = "3",
   "dynamic_partition.prefix" = "p",
   "dynamic_partition.replication_allocation" = "tag.location.default: 1",
   "dynamic_partition.buckets" = "1",
   "dynamic_partition.create_history_partition" = "true",
   "dynamic_partition.history_partition_num" = "30",
   "dynamic_partition.hot_partition_num" = "0",
   "dynamic_partition.reserved_history_periods" = "NULL",
   "dynamic_partition.storage_policy" = "",
   "dynamic_partition.storage_medium" = "HDD",
   "storage_format" = "V2",
   "light_schema_change" = "true",
   "disable_auto_compaction" = "false",
   "enable_single_replica_compaction" = "false"
   );
   
   ### 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

Reply via email to