Skip to content

Commit

Permalink
fix(iceberg): fix iceberg source position and all delete (#18932) (#1…
Browse files Browse the repository at this point in the history
…9302)

Co-authored-by: Xinhao Xu <[email protected]>
  • Loading branch information
github-actions[bot] and xxhZs authored Nov 8, 2024
1 parent d7a2a25 commit 854b497
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 54 deletions.
39 changes: 9 additions & 30 deletions e2e_test/iceberg/test_case/iceberg_source_all_delete.slt
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,20 @@ CREATE SINK sink1 AS select * from mv1 WITH (
s3.access.key = 'hummockadmin',
s3.secret.key = 'hummockadmin',
create_table_if_not_exists = 'true',
commit_checkpoint_interval = 5,
commit_checkpoint_interval = 3,
primary_key = 'i1,i2',
);

statement ok
INSERT INTO s1 (i1, i2, i3)
SELECT s, s::text, s::text FROM generate_series(1, 10000) s;
INSERT INTO s1 (i1, i2, i3) values(1,'1','1'),(2,'2','2'),(3,'3','3'),(4,'4','4'),(5,'5','5');

statement ok
flush

statement ok
DELETE FROM s1
WHERE i1 IN (
SELECT s
FROM generate_series(1, 10000, 2) s
);
DELETE FROM s1 WHERE i1 < 3;

sleep 10s
sleep 16s

statement ok
CREATE SOURCE iceberg_t1_source
Expand All @@ -57,39 +52,23 @@ WITH (
);

statement ok
DELETE FROM s1
WHERE i1 IN (
SELECT s
FROM generate_series(1, 10000, 3) s
);
DELETE FROM s1 WHERE i1 > 4;

statement ok
flush

sleep 15s
sleep 16s

query I
select * from iceberg_t1_source order by i1 limit 5;
----
2 2 2
6 6 6
8 8 8
12 12 12
14 14 14

query I
select * from iceberg_t1_source order by i1 desc limit 5;
----
9998 9998 9998
9996 9996 9996
9992 9992 9992
9990 9990 9990
9986 9986 9986
3 3 3
4 4 4

query I
select count(*) from iceberg_t1_source
----
3333
2

statement ok
DROP SINK sink1;
Expand Down
32 changes: 8 additions & 24 deletions e2e_test/iceberg/test_case/iceberg_source_position_delete.slt
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,20 @@ CREATE SINK sink1 AS select * from mv1 WITH (
s3.access.key = 'hummockadmin',
s3.secret.key = 'hummockadmin',
create_table_if_not_exists = 'true',
commit_checkpoint_interval = 5,
commit_checkpoint_interval = 3,
primary_key = 'i1,i2',
);

statement ok
INSERT INTO s1 (i1, i2, i3)
SELECT s, s::text, s::text FROM generate_series(1, 10000) s;
INSERT INTO s1 (i1, i2, i3) values(1,'1','1'),(2,'2','2'),(3,'3','3'),(4,'4','4'),(5,'5','5');

statement ok
flush

statement ok
DELETE FROM s1
WHERE i1 IN (
SELECT s
FROM generate_series(1, 10000, 2) s
);
DELETE FROM s1 WHERE i1 < 3;

sleep 15s
sleep 16s

statement ok
CREATE SOURCE iceberg_t1_source
Expand All @@ -57,27 +52,16 @@ WITH (
);

query I
select * from iceberg_t1_source order by i1 limit 5;
select * from iceberg_t1_source order by i1;
----
2 2 2
3 3 3
4 4 4
6 6 6
8 8 8
10 10 10

query I
select * from iceberg_t1_source order by i1 desc limit 5;
----
10000 10000 10000
9998 9998 9998
9996 9996 9996
9994 9994 9994
9992 9992 9992
5 5 5

query I
select count(*) from iceberg_t1_source
----
5000
3

statement ok
DROP SINK sink1;
Expand Down

0 comments on commit 854b497

Please sign in to comment.