Skip to content

Commit 9a17629

Browse files
committed
minor improvements
1 parent b9c54be commit 9a17629

File tree

1 file changed

+8
-18
lines changed
  • website/docs/table-design/table-types/pk-table

1 file changed

+8
-18
lines changed

website/docs/table-design/table-types/pk-table/index.md

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -123,44 +123,34 @@ CREATE TABLE T
123123

124124
If the data written to the primary-key table is
125125
sequentially `+I(1, 2.0, 'apple')`, `+I(1, 4.0, 'banana')`, `-D(1, 4.0, 'banana')`, then the following change data will
126-
be generated.For example, the execution process of the following Flink SQL statement:
126+
be generated. For example, the following Flink SQL statements illustrate this behavior:
127127

128128
```sql title="Flink SQL"
129-
-- 1. Switch to batch processing mode
130-
-- In this mode, we can perform POST and DELETE operations.
131-
-- Note: In this environment, full table SELECT is restricted in batch mode.
129+
-- set to batch mode to execute DELETE and INSERT statements
132130
SET execution.runtime-mode = batch;
133131

134-
-- 2. Insert two pieces of data (executed in batch mode)
135-
-- Flink will submit these data as insertion events to the cluster.
132+
-- insert to records with the same primary key k=1
136133
INSERT INTO T (k, v1) VALUES (1, 2.0,'apple');
137134
INSERT INTO T (k, v1) VALUES (1, 4.0,'banana');
138135

139-
-- 3. Perform deletion operation
140-
-- This DELETE operation will mark records with primary key k=1 as deleted.
141-
-- Within Fluss, it generates a '- D' change log event.
136+
-- delete the record with primary key k=1
142137
DELETE FROM T WHERE k = 1;
143138

144-
145-
-- 4. According to the experiment, Fluss has limitations on SELECT in batch processing mode.
146-
-- Only data lake tables or primary key point queries are supported.
147-
-- After switching to streaming mode, we can observe the change logs of the table.
148-
-- The SELECT here will act as a stream query, continuously displaying updates to the table.
139+
-- set to streaming mode to observe the changelogs
149140
SET execution.runtime-mode = streaming;
150141
SELECT * FROM T;
151-
152142
```
153143

154-
Generate the following change data:
155-
156-
144+
Generate the following output in the Flink SQL CLI:
157145

146+
```
158147
| op | k | v1 | v2 |
159148
| ---- | ---- | ---- | ------ |
160149
| +I | 1 | 2.0 | apple |
161150
| -U | 1 | 2.0 | apple |
162151
| +U | 1 | 4.0 | banana |
163152
| -D | 1 | 4.0 | banana |
153+
```
164154

165155
## Data Queries
166156

0 commit comments

Comments
 (0)