-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
178 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
CREATE TABLE numbers_input_df_func ( | ||
number INT, | ||
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP, | ||
PRIMARY KEY(number), | ||
TIME INDEX(ts) | ||
); | ||
|
||
Affected Rows: 0 | ||
|
||
CREATE FLOW test_numbers_df_func | ||
SINK TO out_num_cnt_df_func | ||
AS | ||
SELECT sum(abs(number)) FROM numbers_input_df_func GROUP BY tumble(ts, '1 second', '2021-07-01 00:00:00'); | ||
|
||
Affected Rows: 0 | ||
|
||
INSERT INTO numbers_input_df_func | ||
VALUES | ||
(-20, "2021-07-01 00:00:00.200"), | ||
(22, "2021-07-01 00:00:00.600"); | ||
|
||
Affected Rows: 2 | ||
|
||
-- SQLNESS SLEEP 2s | ||
SELECT col_0, window_start, window_end FROM out_num_cnt_df_func; | ||
|
||
+-------+---------------------+---------------------+ | ||
| col_0 | window_start | window_end | | ||
+-------+---------------------+---------------------+ | ||
| 42 | 2021-07-01T00:00:00 | 2021-07-01T00:00:01 | | ||
+-------+---------------------+---------------------+ | ||
|
||
INSERT INTO numbers_input_df_func | ||
VALUES | ||
(23,"2021-07-01 00:00:01.000"), | ||
(-24,"2021-07-01 00:00:01.500"); | ||
|
||
Affected Rows: 2 | ||
|
||
-- SQLNESS SLEEP 2s | ||
SELECT col_0, window_start, window_end FROM out_num_cnt_df_func; | ||
|
||
+-------+---------------------+---------------------+ | ||
| col_0 | window_start | window_end | | ||
+-------+---------------------+---------------------+ | ||
| 42 | 2021-07-01T00:00:00 | 2021-07-01T00:00:01 | | ||
| 47 | 2021-07-01T00:00:01 | 2021-07-01T00:00:02 | | ||
+-------+---------------------+---------------------+ | ||
|
||
DROP FLOW test_numbers_df_func; | ||
|
||
Affected Rows: 0 | ||
|
||
DROP TABLE numbers_input_df_func; | ||
|
||
Affected Rows: 0 | ||
|
||
DROP TABLE out_num_cnt_df_func; | ||
|
||
Affected Rows: 0 | ||
|
||
CREATE TABLE numbers_input_df_func ( | ||
number INT, | ||
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP, | ||
PRIMARY KEY(number), | ||
TIME INDEX(ts) | ||
); | ||
|
||
Affected Rows: 0 | ||
|
||
CREATE FLOW test_numbers_df_func | ||
SINK TO out_num_cnt_df_func | ||
AS | ||
SELECT abs(sum(number)) FROM numbers_input_df_func GROUP BY tumble(ts, '1 second', '2021-07-01 00:00:00'); | ||
|
||
Affected Rows: 0 | ||
|
||
INSERT INTO numbers_input_df_func | ||
VALUES | ||
(-20, "2021-07-01 00:00:00.200"), | ||
(22, "2021-07-01 00:00:00.600"); | ||
|
||
Affected Rows: 2 | ||
|
||
-- SQLNESS SLEEP 2s | ||
SELECT col_0, window_start, window_end FROM out_num_cnt_df_func; | ||
|
||
+-------+---------------------+---------------------+ | ||
| col_0 | window_start | window_end | | ||
+-------+---------------------+---------------------+ | ||
| 2 | 2021-07-01T00:00:00 | 2021-07-01T00:00:01 | | ||
+-------+---------------------+---------------------+ | ||
|
||
INSERT INTO numbers_input_df_func | ||
VALUES | ||
(23,"2021-07-01 00:00:01.000"), | ||
(-24,"2021-07-01 00:00:01.500"); | ||
|
||
Affected Rows: 2 | ||
|
||
-- SQLNESS SLEEP 2s | ||
SELECT col_0, window_start, window_end FROM out_num_cnt_df_func; | ||
|
||
+-------+---------------------+---------------------+ | ||
| col_0 | window_start | window_end | | ||
+-------+---------------------+---------------------+ | ||
| 2 | 2021-07-01T00:00:00 | 2021-07-01T00:00:01 | | ||
| 1 | 2021-07-01T00:00:01 | 2021-07-01T00:00:02 | | ||
+-------+---------------------+---------------------+ | ||
|
||
DROP FLOW test_numbers_df_func; | ||
|
||
Affected Rows: 0 | ||
|
||
DROP TABLE numbers_input_df_func; | ||
|
||
Affected Rows: 0 | ||
|
||
DROP TABLE out_num_cnt_df_func; | ||
|
||
Affected Rows: 0 | ||
|
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