Skip to content

Commit cd86a6b

Browse files
committed
[doc]The deletion operation requires the equivalence condition of the primary key
1 parent ced8cba commit cd86a6b

File tree

1 file changed

+9
-7
lines changed
  • website/docs/table-design/table-types/pk-table/merge-engines

1 file changed

+9
-7
lines changed

website/docs/table-design/table-types/pk-table/merge-engines/default.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ SELECT * FROM T WHERE k = 1;
5454

5555
-- Update
5656
INSERT INTO T(k, v1, v2) VALUES (2, 2.0, 't2');
57+
-- Switch to batch mode to perform update operation, otherwise an error will be reported: org.apache.flink.table.api.TableException: UPDATE statement is not supported for streaming mode now.
58+
SET execution.runtime-mode = batch;
5759
UPDATE T SET v1 = 4.0 WHERE k = 2;
5860
SELECT * FROM T WHERE k = 2;
5961
-- Output:
@@ -83,12 +85,12 @@ SELECT * FROM T WHERE k = 3;
8385
+----+-----+----+
8486

8587
-- Delete
86-
DELETE FROM T WHERE k > 2;
87-
SELECT * FROM T;
88+
DELETE FROM T WHERE k = 2;
89+
SELECT * FROM T WHERE k = 2;
8890
-- Output:
89-
+----+-----+----+
90-
| k | v1 | v2 |
91-
+----+-----+----+
92-
| 1 | 1.0 | t2 |
93-
+----+-----+----+
91+
+----+-----+------+
92+
| k | v1 | v2 |
93+
+----+-----+------+
94+
|null| null| null |
95+
+----+-----+------+
9496
```

0 commit comments

Comments
 (0)