-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Source, activate on create MV (#617)
* New create source command option; tests * Fix test * Rename flag; remove flag from table_exec * Remove extra argument * Remove args from NewTableExecutor
- Loading branch information
Showing
11 changed files
with
232 additions
and
51 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
dataset:dataset_1 test_source_1 | ||
1,10,1000,1234.4321,12345678.99,str1,2020-01-01 01:00:00.123456 | ||
2,20,2000,2234.4321,22345678.99,str2,2020-01-02 01:00:00.123456 | ||
3,30,3000,3234.4321,32345678.99,str3,2020-01-03 01:00:00.123456 | ||
4,40,4000,4234.4321,42345678.99,str4,2020-01-04 01:00:00.123456 | ||
5,50,5000,5234.4321,52345678.99,str5,2020-01-05 01:00:00.123456 | ||
6,60,6000,6234.4321,62345678.99,str6,2020-01-06 01:00:00.123456 | ||
7,70,7000,7234.4321,72345678.99,str7,2020-01-07 01:00:00.123456 | ||
8,80,8000,8234.4321,82345678.99,str8,2020-01-08 01:00:00.123456 | ||
9,90,9000,9234.4321,92345678.99,str9,2020-01-09 01:00:00.123456 | ||
10,100,10000,10234.4321,93345678.99,str10,2020-01-10 01:00:00.123456 |
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,87 @@ | ||
--create topic testtopic; | ||
use test; | ||
0 rows returned | ||
create source test_source_1( | ||
col0 bigint, | ||
col1 tinyint, | ||
col2 int, | ||
col3 double, | ||
col4 decimal(10, 2), | ||
col5 varchar, | ||
col6 timestamp, | ||
primary key (col0) | ||
) with ( | ||
startwithfirstmv = true, | ||
brokername = "testbroker", | ||
topicname = "testtopic", | ||
headerencoding = "json", | ||
keyencoding = "json", | ||
valueencoding = "json", | ||
columnselectors = ( | ||
meta("key").k0, | ||
v1, | ||
v2, | ||
v3, | ||
v4, | ||
v5, | ||
v6 | ||
) | ||
); | ||
0 rows returned | ||
|
||
--load data dataset_1 no wait; | ||
|
||
--pause 1000; | ||
|
||
select * from test_source_1 order by col0; | ||
+---------------------------------------------------------------------------------------------------------------------+ | ||
| col0 | col1 | col2 | col3 | col4 | col5 | col6 | | ||
+---------------------------------------------------------------------------------------------------------------------+ | ||
0 rows returned | ||
|
||
create materialized view test_mv1 as select * from test_source_1; | ||
0 rows returned | ||
|
||
--wait for rows test_source_1 10; | ||
|
||
select * from test_source_1 order by col0; | ||
+---------------------------------------------------------------------------------------------------------------------+ | ||
| col0 | col1 | col2 | col3 | col4 | col5 | col6 | | ||
+---------------------------------------------------------------------------------------------------------------------+ | ||
| 1 | 10 | 1000 | 1234.432100 | 12345678.99 | str1 | 2020-01-01 01:00:00.000000 | | ||
| 2 | 20 | 2000 | 2234.432100 | 22345678.99 | str2 | 2020-01-02 01:00:00.000000 | | ||
| 3 | 30 | 3000 | 3234.432100 | 32345678.99 | str3 | 2020-01-03 01:00:00.000000 | | ||
| 4 | 40 | 4000 | 4234.432100 | 42345678.99 | str4 | 2020-01-04 01:00:00.000000 | | ||
| 5 | 50 | 5000 | 5234.432100 | 52345678.99 | str5 | 2020-01-05 01:00:00.000000 | | ||
| 6 | 60 | 6000 | 6234.432100 | 62345678.99 | str6 | 2020-01-06 01:00:00.000000 | | ||
| 7 | 70 | 7000 | 7234.432100 | 72345678.99 | str7 | 2020-01-07 01:00:00.000000 | | ||
| 8 | 80 | 8000 | 8234.432100 | 82345678.99 | str8 | 2020-01-08 01:00:00.000000 | | ||
| 9 | 90 | 9000 | 9234.432100 | 92345678.99 | str9 | 2020-01-09 01:00:00.000000 | | ||
| 10 | 100 | 10000 | 10234.432100 | 93345678.99 | str10 | 2020-01-10 01:00:00.000000 | | ||
+---------------------------------------------------------------------------------------------------------------------+ | ||
10 rows returned | ||
|
||
select * from test_mv1 order by col0; | ||
+---------------------------------------------------------------------------------------------------------------------+ | ||
| col0 | col1 | col2 | col3 | col4 | col5 | col6 | | ||
+---------------------------------------------------------------------------------------------------------------------+ | ||
| 1 | 10 | 1000 | 1234.432100 | 12345678.99 | str1 | 2020-01-01 01:00:00.000000 | | ||
| 2 | 20 | 2000 | 2234.432100 | 22345678.99 | str2 | 2020-01-02 01:00:00.000000 | | ||
| 3 | 30 | 3000 | 3234.432100 | 32345678.99 | str3 | 2020-01-03 01:00:00.000000 | | ||
| 4 | 40 | 4000 | 4234.432100 | 42345678.99 | str4 | 2020-01-04 01:00:00.000000 | | ||
| 5 | 50 | 5000 | 5234.432100 | 52345678.99 | str5 | 2020-01-05 01:00:00.000000 | | ||
| 6 | 60 | 6000 | 6234.432100 | 62345678.99 | str6 | 2020-01-06 01:00:00.000000 | | ||
| 7 | 70 | 7000 | 7234.432100 | 72345678.99 | str7 | 2020-01-07 01:00:00.000000 | | ||
| 8 | 80 | 8000 | 8234.432100 | 82345678.99 | str8 | 2020-01-08 01:00:00.000000 | | ||
| 9 | 90 | 9000 | 9234.432100 | 92345678.99 | str9 | 2020-01-09 01:00:00.000000 | | ||
| 10 | 100 | 10000 | 10234.432100 | 93345678.99 | str10 | 2020-01-10 01:00:00.000000 | | ||
+---------------------------------------------------------------------------------------------------------------------+ | ||
10 rows returned | ||
|
||
drop materialized view test_mv1; | ||
0 rows returned | ||
|
||
drop source test_source_1; | ||
0 rows returned | ||
|
||
--delete topic testtopic; |
Oops, something went wrong.