-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support partial checkpoint based backfill (a.k.a snapshot backf…
…ill) (#17735)
- Loading branch information
Showing
47 changed files
with
2,890 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
e2e_test/backfill/snapshot_backfill/check_data_equal.slt.part
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
control substitution on | ||
|
||
# the result from batch query and materialized view should be the same | ||
query T | ||
select * from ${TEST_NAME}_v | ||
except | ||
select * from ${TEST_NAME}_mv; | ||
---- | ||
|
||
query T | ||
select * from ${TEST_NAME}_mv | ||
except | ||
select * from ${TEST_NAME}_v; | ||
---- | ||
|
||
query T | ||
select * from ${TEST_NAME}_extended_mv | ||
except | ||
select * from ${TEST_NAME}_mv; | ||
---- | ||
|
||
query T | ||
select * from ${TEST_NAME}_mv | ||
except | ||
select * from ${TEST_NAME}_extended_mv; | ||
---- |
54 changes: 54 additions & 0 deletions
54
e2e_test/backfill/snapshot_backfill/create_nexmark_table.slt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
statement ok | ||
CREATE table person ( | ||
"id" BIGINT, | ||
"name" VARCHAR, | ||
"email_address" VARCHAR, | ||
"credit_card" VARCHAR, | ||
"city" VARCHAR, | ||
"state" VARCHAR, | ||
"date_time" TIMESTAMP, | ||
"extra" VARCHAR | ||
) with ( | ||
connector = 'nexmark', | ||
nexmark.table.type = 'Person', | ||
nexmark.split.num = '8', | ||
nexmark.min.event.gap.in.ns = '50000' | ||
); | ||
|
||
statement ok | ||
CREATE table auction ( | ||
"id" BIGINT, | ||
"item_name" VARCHAR, | ||
"description" VARCHAR, | ||
"initial_bid" BIGINT, | ||
"reserve" BIGINT, | ||
"date_time" TIMESTAMP, | ||
"expires" TIMESTAMP, | ||
"seller" BIGINT, | ||
"category" BIGINT, | ||
"extra" VARCHAR | ||
) with ( | ||
connector = 'nexmark', | ||
nexmark.table.type = 'Auction', | ||
nexmark.split.num = '8', | ||
nexmark.min.event.gap.in.ns = '50000' | ||
); | ||
|
||
statement ok | ||
CREATE table bid ( | ||
"auction" BIGINT, | ||
"bidder" BIGINT, | ||
"price" BIGINT, | ||
"channel" VARCHAR, | ||
"url" VARCHAR, | ||
"date_time" TIMESTAMP, | ||
"extra" VARCHAR | ||
) with ( | ||
connector = 'nexmark', | ||
nexmark.table.type = 'Bid', | ||
nexmark.split.num = '8', | ||
nexmark.min.event.gap.in.ns = '100000' | ||
); | ||
|
||
# sleep for a while to let table accumulate enough data | ||
sleep 10s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
statement ok | ||
drop table bid; | ||
|
||
statement ok | ||
drop table auction; | ||
|
||
statement ok | ||
drop table person; |
14 changes: 14 additions & 0 deletions
14
e2e_test/backfill/snapshot_backfill/nexmark/nexmark_q3.slt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
control substitution on | ||
|
||
statement ok | ||
create view ${TEST_NAME}_v as | ||
SELECT P.name, | ||
P.city, | ||
P.state, | ||
A.id | ||
FROM auction AS A | ||
INNER JOIN person AS P on A.seller = P.id | ||
WHERE A.category = 10 | ||
and (P.state = 'or' OR P.state = 'id' OR P.state = 'ca'); | ||
|
||
include ../run_test.slt.part |
25 changes: 25 additions & 0 deletions
25
e2e_test/backfill/snapshot_backfill/nexmark/nexmark_q7.slt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
control substitution on | ||
|
||
statement ok | ||
create view ${TEST_NAME}_v as | ||
SELECT | ||
B.auction, | ||
B.price, | ||
B.bidder, | ||
B.date_time | ||
from | ||
bid B | ||
JOIN ( | ||
SELECT | ||
MAX(price) AS maxprice, | ||
window_end as date_time | ||
FROM | ||
TUMBLE(bid, date_time, INTERVAL '10' SECOND) | ||
GROUP BY | ||
window_end | ||
) B1 ON B.price = B1.maxprice | ||
WHERE | ||
B.date_time BETWEEN B1.date_time - INTERVAL '10' SECOND | ||
AND B1.date_time; | ||
|
||
include ../run_test.slt.part |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
control substitution on | ||
|
||
statement ok | ||
set backfill_rate_limit = 500; | ||
|
||
statement ok | ||
set streaming_use_snapshot_backfill = true; | ||
|
||
statement ok | ||
create materialized view ${TEST_NAME}_mv as select * from ${TEST_NAME}_v; | ||
|
||
statement ok | ||
create materialized view ${TEST_NAME}_extended_mv as select * from ${TEST_NAME}_mv; | ||
|
||
include ./check_data_equal.slt.part | ||
|
||
sleep 3s | ||
|
||
include ./check_data_equal.slt.part | ||
|
||
statement ok | ||
drop materialized view ${TEST_NAME}_extended_mv; | ||
|
||
statement ok | ||
drop materialized view ${TEST_NAME}_mv; | ||
|
||
statement ok | ||
drop view ${TEST_NAME}_v; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.