Skip to content

Commit 9f22806

Browse files
committed
[docs] Fix examples in first-row and versioned merge engine
1 parent f68e306 commit 9f22806

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ CREATE TABLE T (
3535
INSERT INTO T VALUES (1, 2.0, 't1');
3636
INSERT INTO T VALUES (1, 3.0, 't2');
3737

38-
SELECT * FROM T;
38+
SELECT * FROM T WHERE k = 1;
3939

4040
-- Output
4141
-- +---+-----+------+

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ The version column can be of the following data types:
4141
## Example:
4242

4343
```sql title="Flink SQL"
44-
4544
CREATE TABLE VERSIONED (
4645
a INT NOT NULL PRIMARY KEY NOT ENFORCED,
4746
b STRING,
@@ -50,11 +49,12 @@ CREATE TABLE VERSIONED (
5049
'table.merge-engine' = 'versioned',
5150
'table.merge-engine.versioned.ver-column' = 'ts'
5251
);
52+
5353
INSERT INTO VERSIONED (a, b, ts) VALUES (1, 'v1', 1000);
5454

5555
-- insert data with ts < 1000, no update will be made
5656
INSERT INTO VERSIONED (a, b, ts) VALUES (1, 'v2', 999);
57-
SELECT * FROM VERSIONED;
57+
SELECT * FROM VERSIONED WHERE a = 1;
5858
-- Output
5959
-- +---+-----+------+
6060
-- | a | b | ts |
@@ -65,7 +65,7 @@ SELECT * FROM VERSIONED;
6565

6666
-- insert data with ts > 1000, update will be made
6767
INSERT INTO VERSIONED (a, b, ts) VALUES (1, 'v3', 2000);
68-
SELECT * FROM VERSIONED;
68+
SELECT * FROM VERSIONED WHERE a = 1;
6969
-- Output
7070
-- +---+-----+------+
7171
-- | a | b | ts |
@@ -74,13 +74,12 @@ SELECT * FROM VERSIONED;
7474
-- +---+-----+------+
7575

7676
-- insert data with ts = null, no update will be made
77-
INSERT INTO VERSIONED (a, b, ts) VALUES (1, 'v4', null);
78-
SELECT * FROM VERSIONED;
77+
INSERT INTO VERSIONED (a, b, ts) VALUES (1, 'v4', CAST(null as BIGINT));
78+
SELECT * FROM VERSIONED WHERE a = 1;
7979
-- Output
8080
-- +---+-----+------+
8181
-- | a | b | ts |
8282
-- +---+-----+------+
8383
-- | 1 | v3 | 2000 |
8484
-- +---+-----+------+
85-
8685
```

0 commit comments

Comments
 (0)