HappenLee commented on code in PR #2566:
URL: https://github.com/apache/doris-website/pull/2566#discussion_r2179205493
##########
i18n/zh-CN/docusaurus-plugin-content-docs/current/query-data/window-function.md:
##########
@@ -492,87 +494,47 @@ where year in (1999, 2000, 2001, 2002)
8 rows in set (0.16 sec)
```
-## 分析函数数据的唯一排序
-
-**1. 存在返回结果不一致的问题**
-
-当使用窗口函数的 `ORDER BY` 子句未能产生数据的唯一排序时,例如当 `ORDER BY`
表达式导致重复值时,行的顺序会变得不确定。这意味着在多次执行查询时,这些行的返回顺序可能会有所不同,进而导致窗口函数返回不一致的结果。
-
-通过以下示例可以看出,该查询在多次运行时返回了不同的结果。出现不一致性的情况主要由于 `ORDER BY dateid` 没有为 `SUM`
窗口函数提供产生数据的唯一排序。
+1. 假设我们有如下的股票数据,股票代码是 JDR,closing price 是每天的收盘价。
```sql
-CREATE TABLE test_window_order
- (item_id int,
- date_time date,
- sales double)
-distributed BY hash(item_id)
-properties("replication_num" = 1);
-
-INSERT INTO test_window_order VALUES
-(1, '2024-07-01', 100),
-(2, '2024-07-01', 100),
-(3, '2024-07-01', 140);
-
-SELECT
- item_id, date_time, sales,
- sum(sales) OVER (ORDER BY date_time ROWS BETWEEN
- UNBOUNDED PRECEDING AND CURRENT ROW) sum
-FROM
- test_window_order;
+create table stock_ticker (stock_symbol string, closing_price decimal(8,2),
closing_date timestamp);
+...load some data...
Review Comment:
建议直接完整的写出可复现的导入建表语句,看起来数据条目不多
--
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]