martin-g commented on code in PR #24567:
URL: https://github.com/apache/datafusion/pull/24567#discussion_r3950403746
##########
docs/source/user-guide/sql/dml.md:
##########
@@ -136,3 +136,114 @@ INSERT INTO <i><b>table_name</i></b> { VALUES (
<i><b>expression</i></b> [, ...]
| 2 |
+-------+
```
+
+## DELETE
+
+Removes rows from a table.
+
+<pre>
+DELETE FROM <i><b>table_name</i></b> [ WHERE <i><b>condition</i></b> ]
+</pre>
+
+`DELETE` returns the number of removed rows in a column named `count`.
+
+If you omit the `WHERE` clause, DataFusion removes all rows.
+
+DataFusion removes a row only if the condition is true for that row. SQL
three-valued logic applies: if the condition evaluates to `NULL`, the row
remains. For example, `WHERE value > 15` keeps a row with a `NULL` value,
because `NULL > 15` is `NULL`.
+
+Not all tables support `DELETE`. See [Table support for DELETE and
UPDATE](#table-support-for-delete-and-update).
+
+### Examples
+
+Remove the rows that match a condition:
+
+```sql
+> DELETE FROM target_table WHERE id > 1;
++-------+
+| count |
++-------+
+| 2 |
++-------+
+```
+
+Remove all rows:
+
+```sql
+> DELETE FROM target_table;
++-------+
+| count |
++-------+
+| 3 |
++-------+
+```
+
+## UPDATE
+
+Changes the values of existing rows.
+
+<pre>
+UPDATE <i><b>table_name</i></b> SET <i><b>column</i></b> =
<i><b>expression</i></b> [, ...] [ WHERE <i><b>condition</i></b> ]
Review Comment:
```suggestion
UPDATE <i><b>table_name</b></i> SET <i><b>column</b></i> =
<i><b>expression</b></i> [, ...] [ WHERE <i><b>condition</b></i> ]
```
##########
docs/source/user-guide/sql/dml.md:
##########
@@ -136,3 +136,114 @@ INSERT INTO <i><b>table_name</i></b> { VALUES (
<i><b>expression</i></b> [, ...]
| 2 |
+-------+
```
+
+## DELETE
+
+Removes rows from a table.
+
+<pre>
+DELETE FROM <i><b>table_name</i></b> [ WHERE <i><b>condition</i></b> ]
Review Comment:
```suggestion
DELETE FROM <i><b>table_name</b></i> [ WHERE <i><b>condition</b></i> ]
```
##########
docs/source/user-guide/sql/dml.md:
##########
@@ -136,3 +136,114 @@ INSERT INTO <i><b>table_name</i></b> { VALUES (
<i><b>expression</i></b> [, ...]
| 2 |
+-------+
```
+
+## DELETE
+
+Removes rows from a table.
+
+<pre>
+DELETE FROM <i><b>table_name</i></b> [ WHERE <i><b>condition</i></b> ]
+</pre>
+
+`DELETE` returns the number of removed rows in a column named `count`.
+
+If you omit the `WHERE` clause, DataFusion removes all rows.
+
+DataFusion removes a row only if the condition is true for that row. SQL
three-valued logic applies: if the condition evaluates to `NULL`, the row
remains. For example, `WHERE value > 15` keeps a row with a `NULL` value,
because `NULL > 15` is `NULL`.
+
+Not all tables support `DELETE`. See [Table support for DELETE and
UPDATE](#table-support-for-delete-and-update).
+
+### Examples
+
+Remove the rows that match a condition:
+
+```sql
+> DELETE FROM target_table WHERE id > 1;
++-------+
+| count |
++-------+
+| 2 |
++-------+
+```
+
+Remove all rows:
+
+```sql
+> DELETE FROM target_table;
++-------+
+| count |
++-------+
+| 3 |
++-------+
+```
+
+## UPDATE
+
+Changes the values of existing rows.
+
+<pre>
+UPDATE <i><b>table_name</i></b> SET <i><b>column</i></b> =
<i><b>expression</i></b> [, ...] [ WHERE <i><b>condition</i></b> ]
+</pre>
+
+`UPDATE` returns the number of changed rows in a column named `count`.
Review Comment:
```suggestion
`UPDATE` returns the number of affected rows in a column named `count`.
```
nit: Maybe `affected` would be better here because old and new values are
not compared.
UPDATE-ing to the same value is counted but it is not really `changed`.
--
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]