Skip to content

Commit

Permalink
add task test
Browse files Browse the repository at this point in the history
  • Loading branch information
xudong963 committed Sep 24, 2024
1 parent 902c2d0 commit 575dc37
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/query/functions/tests/it/scalars/testdata/boolean.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ error:
--> SQL:1:1
|
1 | 'a' and 1
| ^^^ cannot parse to type `BOOLEAN` while evaluating function `to_boolean('a')` in expr `to_boolean('a')`, during run expr: `to_boolean('a') AND to_boolean(1)`
| ^^^ cannot parse to type `BOOLEAN` while evaluating function `to_boolean('a')` in expr `to_boolean('a')`, during run expr: `(to_boolean('a') AND to_boolean(1))`



Expand Down
16 changes: 16 additions & 0 deletions tests/sqllogictests/suites/task/task_dag_test.test
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,19 @@ select name, warehouse, schedule, definition from system.task_history where name
----
mytaskroot mywh CRON 0 0 0 1 1 ? 2100 SELECT 1

statement ok
DROP TASK IF EXISTS mytaskchild2

statement ok
CREATE TASK mytaskchild2
WAREHOUSE = 'mywh'
AFTER 'mytaskroot'
WHEN ((SYSTEM$STREAM_HAS_DATA('stream1') AND SYSTEM$STREAM_HAS_DATA('stream2')) OR (SYSTEM$STREAM_HAS_DATA('stream3') AND SYSTEM$STREAM_HAS_DATA('stream4'))) AND SYSTEM$STREAM_HAS_DATA('stream5')
AS SELECT 1;



query SSSS
select name, warehouse, schedule, definition, condition_text, after from system.tasks where name = 'mytaskchild2'
----
mytaskchild2 mywh NULL SELECT 1 ((SYSTEM$STREAM_HAS_DATA('stream1') AND SYSTEM$STREAM_HAS_DATA('stream2')) OR (SYSTEM$STREAM_HAS_DATA('stream3') AND SYSTEM$STREAM_HAS_DATA('stream4'))) AND SYSTEM$STREAM_HAS_DATA('stream5') mytaskroot

0 comments on commit 575dc37

Please sign in to comment.