-
Notifications
You must be signed in to change notification settings - Fork 590
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add kafka backfill frontend (#15602)
- Loading branch information
Showing
56 changed files
with
1,275 additions
and
308 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Test in this directory needs some prior setup. | ||
|
||
See also `ci/scripts/e2e-source-test.sh`, and `scripts/source` | ||
|
||
## Kafka | ||
|
||
`scripts/source/test_data` contains the data. Filename's convention is `<topic_name>.<n_partitions>`. |
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,58 @@ | ||
control substitution on | ||
|
||
statement ok | ||
SET rw_enable_shared_source TO true; | ||
|
||
statement ok | ||
create source s0 (v1 int, v2 varchar) with ( | ||
connector = 'kafka', | ||
topic = 'kafka_4_partition_topic', | ||
properties.bootstrap.server = '${KAFKA_BOOTSTRAP_SERVER:message_queue:29092}', | ||
scan.startup.mode = 'earliest' | ||
) FORMAT PLAIN ENCODE JSON; | ||
|
||
statement ok | ||
create materialized view mv_1 as select * from s0; | ||
|
||
statement ok | ||
SET rw_enable_shared_source TO false; | ||
|
||
statement ok | ||
create materialized view mv_2 as select * from s0; | ||
|
||
statement ok | ||
flush; | ||
|
||
# Wait enough time to ensure SourceExecutor consumes all Kafka data. | ||
sleep 1s | ||
|
||
query IT rowsort | ||
select v1, v2 from s0; | ||
---- | ||
1 1 | ||
2 22 | ||
3 333 | ||
4 4444 | ||
|
||
query IT rowsort | ||
select v1, v2 from mv_1; | ||
---- | ||
1 1 | ||
2 22 | ||
3 333 | ||
4 4444 | ||
|
||
query IT rowsort | ||
select v1, v2 from mv_2; | ||
---- | ||
1 1 | ||
2 22 | ||
3 333 | ||
4 4444 | ||
|
||
# TODO: add more data to the topic and re-check the data. Currently there's no good test infra to do this... | ||
# To test the correctness of source backfill, we might need to keep producing data during an interval, to let it go | ||
# through the backfill stage to the forward stage. | ||
|
||
statement ok | ||
drop source s0 cascade; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
This folder contains scripts to prepare data for testing sources. | ||
|
||
## Kafka | ||
|
||
`scripts/source/test_data` contains the data. Filename's convention is `<topic_name>.<n_partitions>`. |
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
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.