github-actions[bot] commented on code in PR #3495:
URL: https://github.com/apache/doris-website/pull/3495#discussion_r2992968274
##########
docs/sql-manual/sql-statements/data-modification/DML/DELETE.md:
##########
@@ -38,14 +40,16 @@ DELETE FROM table_name
+ column_name: column belong to table_name
+ op: Logical comparison operator, The optional types of op include: =, >, <,
>=, <=, !=, in, not in
+ value | value_list: value or value list used for logial comparison
-+ WHERE condition: Specifies a condition to use to select rows for removal
#### Optional Parameters
+ cte: Common Table Expression, e.g. 'WITH a AS SELECT * FROM tbl'.
+ PARTITION partition_name | PARTITIONS (partition_name [, partition_name]):
Specifies the partition or partitions to select rows for removal
+ table_alias: alias of table
+ USING additional_tables: If you need to refer to additional tables in the
WHERE clause to help identify the rows to be removed, then specify those table
names in the USING clause. You can also use the USING clause to specify
subqueries that identify the rows to be removed.
++ WHERE condition: Specifies a condition to use to select rows for removal.
Required for Syntax 1. Optional for Syntax 2.
++ ORDER BY column: Specifies the order in which rows are deleted. Typically
used together with LIMIT to control which rows are affected.
++ LIMIT [offset,] count: Limits the number of rows to be deleted. When used
with ORDER BY, deletes the first `count` rows after sorting. If `offset` is
specified, skips the first `offset` rows before deleting. If used without ORDER
BY, the set of affected rows is non-deterministic.
Review Comment:
**Missing version callout:** The `:::tip` block indicating that ORDER BY and
LIMIT in DELETE are supported since version 4.1.0 is present in
`versioned_docs/version-4.x/DELETE.md` but missing here in the `dev` (current)
docs. Users reading the latest docs need to know the minimum version
requirement.
Suggested addition after this block:
```
:::tip
ORDER BY and LIMIT in DELETE statements are supported since version 4.1.0.
:::
```
##########
docs/sql-manual/sql-statements/data-modification/DML/UPDATE.md:
##########
@@ -18,25 +18,31 @@ The UPDATE operation currently only supports updating the
Value column. The upda
UPDATE target_table [table_alias]
SET assignment_list
[ FROM additional_tables]
- WHERE condition
+ [WHERE condition]
+ [ORDER BY column [ASC | DESC] [NULLS FIRST | NULLS LAST] [, ...]]
+ [LIMIT [offset,] count]
```
#### Required Parameters
+ target_table: The target table of the data to be updated. Can be of the form
'db_name.table_name'
+ assignment_list: The target column to be updated, in the format 'col_name =
value, col_name = value'
-+ where condition: the condition that is expected to be updated, an expression
that returns true or false can be
#### Optional Parameters
+ cte: Common Table Expression, eg 'WITH a AS SELECT * FROM tbl'
+ table_alias: alias of table
+ FROM additional_tables: Specifies one or more tables to use for selecting
rows to update or for setting new values. Note that if you want use target
table here, you should give it a alias explicitly.
++ WHERE condition: The condition that is expected to be updated, an expression
that returns true or false.
++ ORDER BY column: Specifies the order in which rows are updated. Typically
used together with LIMIT to control which rows are affected.
++ LIMIT [offset,] count: Limits the number of rows to be updated. When used
with ORDER BY, updates the first `count` rows after sorting. If `offset` is
specified, skips the first `offset` rows before updating. If used without ORDER
BY, the set of affected rows is non-deterministic.
Review Comment:
**Missing version callout:** The `:::tip` block indicating ORDER BY and
LIMIT support since version 4.1.0 is present in
`versioned_docs/version-4.x/UPDATE.md` but missing here in the `dev` (current)
docs.
Suggested addition after this block:
```
:::tip
ORDER BY and LIMIT in UPDATE statements are supported since version 4.1.0.
:::
```
##########
docs/sql-manual/sql-statements/data-modification/DML/DELETE.md:
##########
@@ -179,6 +184,18 @@ This feature is supported since the Apache Doris 1.2
version
where lineitem.o_orderkey = discount_orders.o_orderkey;
```
+6. Delete with ORDER BY and LIMIT — delete the first 3 rows ordered by k1 in
ascending order
+
+ ```sql
+ DELETE FROM my_table ORDER BY k1 ASC LIMIT 3;
+ ```
Review Comment:
**Missing expected output:** Per the documentation standard, each example
query should be followed by its expected output in a fenced `text` block. For
DML statements, this is typically the affected-rows confirmation. For example:
```text
Query OK, 3 rows affected
```
Please add expected output for examples 6 and 7.
##########
docs/sql-manual/sql-statements/data-modification/DML/UPDATE.md:
##########
@@ -151,6 +157,18 @@ from discount_orders
where lineitem.o_orderkey = discount_orders.o_orderkey;
```
+5. Update with ORDER BY and LIMIT — update the v1 column to 0 for the first 3
rows with the largest v1 values where k1 > 0
+
+```sql
+UPDATE test SET v1 = 0 WHERE k1 > 0 ORDER BY v1 DESC LIMIT 3;
+```
Review Comment:
**Missing expected output:** Per the documentation standard, each example
query should be followed by its expected output in a fenced `text` block. For
DML statements, this is typically the affected-rows confirmation. For example:
```text
Query OK, 3 rows affected
```
Please add expected output for examples 5 and 6.
##########
i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/DML/DELETE.md:
##########
@@ -38,14 +40,16 @@ DELETE FROM table_name [table_alias]
+ column_name: 属于 table_name 的列
+ op: 逻辑比较操作符,可选类型包括:=, >, <, >=, <=, !=, in, not in
+ value | value_list: 做逻辑比较的值或值列表
-+ WHERE condition: 指定一个用于选择删除行的条件
#### Optional Parameters
+ cte: 通用表达式。可以是 'WITH a AS SELECT * FROM tbl' 形式
+ PARTITION partition_name | PARTITIONS (partition_name [, partition_name]):
指定执行删除数据的分区名,如果表不存在此分区,则报错
+ table_alias: 表的别名
+ USING additional_tables: 如果需要在 WHERE 语句中使用其他的表来帮助识别需要删除的行,则可以在 USING
中指定这些表或者查询。
++ WHERE condition: 指定一个用于选择删除行的条件。语法一中为必填项,语法二中为可选项。
++ ORDER BY column: 指定删除行的排序方式。通常与 LIMIT 一起使用,以控制哪些行会被删除。
++ LIMIT [offset,] count: 限制删除的行数。与 ORDER BY 一起使用时,排序后删除前 `count` 行。如果指定了
`offset`,则跳过排序后的前 `offset` 行再进行删除。如果不配合 ORDER BY 使用,受影响的行是不确定的。
Review Comment:
**Missing version callout:** The `:::tip` version callout (present in
`version-4.x`) is missing here. Since this is the `current`/`dev` locale file,
users reading the Chinese docs also need the version context:
```
:::tip
DELETE 语句中的 ORDER BY 和 LIMIT 自 4.1.0 版本起支持。
:::
```
##########
i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/data-modification/DML/UPDATE.md:
##########
@@ -19,25 +19,31 @@ UPDATE 操作目前只支持更新 Value 列,Key 列的更新可参考[使用
UPDATE target_table [table_alias]
SET assignment_list
[ FROM additional_tables]
- WHERE condition
+ [WHERE condition]
+ [ORDER BY column [ASC | DESC] [NULLS FIRST | NULLS LAST] [, ...]]
+ [LIMIT [offset,] count]
```
#### Required Parameters
+ target_table: 待更新数据的目标表。可以是 'db_name.table_name' 形式
+ assignment_list: 待更新的目标列,形如 'col_name = value, col_name = value' 格式
-+ WHERE condition: 期望更新的条件,一个返回 true 或者 false 的表达式即可
#### Optional Parameters
+ cte: 通用表达式。可以是 'WITH a AS SELECT * FROM tbl' 形式
+ table_alias: 表的别名
+ FROM additional_tables:
指定一个或多个表,用于选中更新的行,或者获取更新的值。注意,如需要在此列表中再次使用目标表,需要为其显式指定别名。
++ WHERE condition: 期望更新的条件,一个返回 true 或者 false 的表达式即可。
++ ORDER BY column: 指定更新行的排序方式。通常与 LIMIT 一起使用,以控制哪些行会被更新。
++ LIMIT [offset,] count: 限制更新的行数。与 ORDER BY 一起使用时,排序后更新前 `count` 行。如果指定了
`offset`,则跳过排序后的前 `offset` 行再进行更新。如果不配合 ORDER BY 使用,受影响的行是不确定的。
Review Comment:
**Missing version callout:** The `:::tip` version callout (present in
`version-4.x`) is missing here. Please add:
```
:::tip
UPDATE 语句中的 ORDER BY 和 LIMIT 自 4.1.0 版本起支持。
:::
```
--
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]