Skip to content

Commit 4c32e23

Browse files
committed
test: add test-private-task-warehouse.sh
1 parent 8ce6eb0 commit 4c32e23

File tree

5 files changed

+269
-15
lines changed

5 files changed

+269
-15
lines changed
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
// Copyright 2023 Datafuse Labs.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
use chrono::DateTime;
16+
use databend_common_meta_app::principal as mt;
17+
use databend_common_meta_app::principal::ScheduleOptions;
18+
use databend_common_meta_app::principal::ScheduleType;
19+
use databend_common_meta_app::principal::WarehouseOptions;
20+
use fastrace::func_name;
21+
use maplit::btreemap;
22+
23+
use crate::common;
24+
25+
#[test]
26+
fn test_decode_v138_task_message() -> anyhow::Result<()> {
27+
let want_task = || mt::Task {
28+
task_id: 11,
29+
task_name: "task_c".to_string(),
30+
query_text: "SELECT * FROM t1".to_string(),
31+
when_condition: Some("c1 > 1".to_string()),
32+
after: vec!["task_a".to_string(), "task_b".to_string()],
33+
comment: Some("comment".to_string()),
34+
owner: "public".to_string(),
35+
owner_user: "me".to_string(),
36+
schedule_options: Some(ScheduleOptions {
37+
interval: Some(11),
38+
cron: Some("30 12 * * *".to_string()),
39+
time_zone: Some("UTC".to_string()),
40+
schedule_type: ScheduleType::IntervalType,
41+
milliseconds_interval: Some(11),
42+
}),
43+
warehouse_options: Some(WarehouseOptions {
44+
warehouse: Some("warehouse_a".to_string()),
45+
using_warehouse_size: Some("10".to_string()),
46+
}),
47+
next_scheduled_at: Some(DateTime::from_timestamp(10, 0).unwrap()),
48+
suspend_task_after_num_failures: Some(10),
49+
error_integration: None,
50+
status: mt::Status::Suspended,
51+
created_at: DateTime::from_timestamp(11, 0).unwrap(),
52+
updated_at: DateTime::from_timestamp(12, 0).unwrap(),
53+
last_suspended_at: Some(DateTime::from_timestamp(13, 0).unwrap()),
54+
session_params: btreemap! { s("a") => s("b") },
55+
};
56+
57+
{
58+
let task_message_execute_v138 = vec![
59+
10, 239, 1, 8, 11, 18, 6, 116, 97, 115, 107, 95, 99, 34, 16, 83, 69, 76, 69, 67, 84,
60+
32, 42, 32, 70, 82, 79, 77, 32, 116, 49, 42, 7, 99, 111, 109, 109, 101, 110, 116, 50,
61+
6, 112, 117, 98, 108, 105, 99, 58, 22, 8, 11, 18, 11, 51, 48, 32, 49, 50, 32, 42, 32,
62+
42, 32, 42, 26, 3, 85, 84, 67, 40, 11, 66, 17, 10, 11, 119, 97, 114, 101, 104, 111,
63+
117, 115, 101, 95, 97, 18, 2, 49, 48, 74, 23, 49, 57, 55, 48, 45, 48, 49, 45, 48, 49,
64+
32, 48, 48, 58, 48, 48, 58, 49, 48, 32, 85, 84, 67, 80, 10, 114, 23, 49, 57, 55, 48,
65+
45, 48, 49, 45, 48, 49, 32, 48, 48, 58, 48, 48, 58, 49, 49, 32, 85, 84, 67, 122, 23,
66+
49, 57, 55, 48, 45, 48, 49, 45, 48, 49, 32, 48, 48, 58, 48, 48, 58, 49, 50, 32, 85, 84,
67+
67, 130, 1, 23, 49, 57, 55, 48, 45, 48, 49, 45, 48, 49, 32, 48, 48, 58, 48, 48, 58, 49,
68+
51, 32, 85, 84, 67, 138, 1, 6, 116, 97, 115, 107, 95, 97, 138, 1, 6, 116, 97, 115, 107,
69+
95, 98, 146, 1, 6, 99, 49, 32, 62, 32, 49, 154, 1, 6, 10, 1, 97, 18, 1, 98, 170, 1, 2,
70+
109, 101, 160, 6, 137, 1, 168, 6, 24, 160, 6, 137, 1, 168, 6, 24,
71+
];
72+
let want_execute = || mt::TaskMessage::ExecuteTask(want_task());
73+
74+
common::test_pb_from_to(func_name!(), want_execute())?;
75+
common::test_load_old(
76+
func_name!(),
77+
task_message_execute_v138.as_slice(),
78+
138,
79+
want_execute(),
80+
)?;
81+
}
82+
{
83+
let task_message_schedule_v138 = vec![
84+
18, 239, 1, 8, 11, 18, 6, 116, 97, 115, 107, 95, 99, 34, 16, 83, 69, 76, 69, 67, 84,
85+
32, 42, 32, 70, 82, 79, 77, 32, 116, 49, 42, 7, 99, 111, 109, 109, 101, 110, 116, 50,
86+
6, 112, 117, 98, 108, 105, 99, 58, 22, 8, 11, 18, 11, 51, 48, 32, 49, 50, 32, 42, 32,
87+
42, 32, 42, 26, 3, 85, 84, 67, 40, 11, 66, 17, 10, 11, 119, 97, 114, 101, 104, 111,
88+
117, 115, 101, 95, 97, 18, 2, 49, 48, 74, 23, 49, 57, 55, 48, 45, 48, 49, 45, 48, 49,
89+
32, 48, 48, 58, 48, 48, 58, 49, 48, 32, 85, 84, 67, 80, 10, 114, 23, 49, 57, 55, 48,
90+
45, 48, 49, 45, 48, 49, 32, 48, 48, 58, 48, 48, 58, 49, 49, 32, 85, 84, 67, 122, 23,
91+
49, 57, 55, 48, 45, 48, 49, 45, 48, 49, 32, 48, 48, 58, 48, 48, 58, 49, 50, 32, 85, 84,
92+
67, 130, 1, 23, 49, 57, 55, 48, 45, 48, 49, 45, 48, 49, 32, 48, 48, 58, 48, 48, 58, 49,
93+
51, 32, 85, 84, 67, 138, 1, 6, 116, 97, 115, 107, 95, 97, 138, 1, 6, 116, 97, 115, 107,
94+
95, 98, 146, 1, 6, 99, 49, 32, 62, 32, 49, 154, 1, 6, 10, 1, 97, 18, 1, 98, 170, 1, 2,
95+
109, 101, 160, 6, 137, 1, 168, 6, 24, 160, 6, 137, 1, 168, 6, 24,
96+
];
97+
let want_schedule = || mt::TaskMessage::ScheduleTask(want_task());
98+
99+
common::test_pb_from_to(func_name!(), want_schedule())?;
100+
common::test_load_old(
101+
func_name!(),
102+
task_message_schedule_v138.as_slice(),
103+
138,
104+
want_schedule(),
105+
)?;
106+
}
107+
{
108+
let task_message_after_v138 = vec![
109+
34, 239, 1, 8, 11, 18, 6, 116, 97, 115, 107, 95, 99, 34, 16, 83, 69, 76, 69, 67, 84,
110+
32, 42, 32, 70, 82, 79, 77, 32, 116, 49, 42, 7, 99, 111, 109, 109, 101, 110, 116, 50,
111+
6, 112, 117, 98, 108, 105, 99, 58, 22, 8, 11, 18, 11, 51, 48, 32, 49, 50, 32, 42, 32,
112+
42, 32, 42, 26, 3, 85, 84, 67, 40, 11, 66, 17, 10, 11, 119, 97, 114, 101, 104, 111,
113+
117, 115, 101, 95, 97, 18, 2, 49, 48, 74, 23, 49, 57, 55, 48, 45, 48, 49, 45, 48, 49,
114+
32, 48, 48, 58, 48, 48, 58, 49, 48, 32, 85, 84, 67, 80, 10, 114, 23, 49, 57, 55, 48,
115+
45, 48, 49, 45, 48, 49, 32, 48, 48, 58, 48, 48, 58, 49, 49, 32, 85, 84, 67, 122, 23,
116+
49, 57, 55, 48, 45, 48, 49, 45, 48, 49, 32, 48, 48, 58, 48, 48, 58, 49, 50, 32, 85, 84,
117+
67, 130, 1, 23, 49, 57, 55, 48, 45, 48, 49, 45, 48, 49, 32, 48, 48, 58, 48, 48, 58, 49,
118+
51, 32, 85, 84, 67, 138, 1, 6, 116, 97, 115, 107, 95, 97, 138, 1, 6, 116, 97, 115, 107,
119+
95, 98, 146, 1, 6, 99, 49, 32, 62, 32, 49, 154, 1, 6, 10, 1, 97, 18, 1, 98, 170, 1, 2,
120+
109, 101, 160, 6, 137, 1, 168, 6, 24, 160, 6, 137, 1, 168, 6, 24,
121+
];
122+
let want_after = || mt::TaskMessage::AfterTask(want_task());
123+
124+
common::test_pb_from_to(func_name!(), want_after())?;
125+
common::test_load_old(
126+
func_name!(),
127+
task_message_after_v138.as_slice(),
128+
138,
129+
want_after(),
130+
)?;
131+
}
132+
{
133+
let task_message_delete_v138 = vec![
134+
26, 27, 10, 6, 116, 97, 115, 107, 95, 99, 18, 17, 10, 11, 119, 97, 114, 101, 104, 111,
135+
117, 115, 101, 95, 97, 18, 2, 49, 48, 160, 6, 137, 1, 168, 6, 24,
136+
];
137+
let want_delete = || {
138+
let task = want_task();
139+
mt::TaskMessage::DeleteTask(task.task_name, task.warehouse_options)
140+
};
141+
142+
common::test_pb_from_to(func_name!(), want_delete())?;
143+
common::test_load_old(
144+
func_name!(),
145+
task_message_delete_v138.as_slice(),
146+
138,
147+
want_delete(),
148+
)?;
149+
}
150+
151+
Ok(())
152+
}
153+
154+
fn s(ss: impl ToString) -> String {
155+
ss.to_string()
156+
}

src/query/service/src/task/service.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ use databend_common_ast::ast::AlterTaskOptions;
3030
use databend_common_base::base::GlobalInstance;
3131
use databend_common_base::runtime::Runtime;
3232
use databend_common_base::runtime::TrySpawn;
33+
use databend_common_catalog::table_context::TableContext;
3334
use databend_common_config::GlobalConfig;
3435
use databend_common_config::InnerConfig;
3536
use databend_common_exception::ErrorCode;
@@ -208,8 +209,13 @@ impl TaskService {
208209
..
209210
}) = task_message.warehouse_options()
210211
{
211-
// [WarehouseInfo::SelfManaged] uses ClusterId as warehouse
212-
if warehouse != &self.cluster_id {
212+
if warehouse
213+
!= &self
214+
.create_context(None)
215+
.await?
216+
.get_cluster()
217+
.get_warehouse_id()?
218+
{
213219
continue;
214220
}
215221
}
@@ -282,7 +288,7 @@ impl TaskService {
282288
let Some(_guard) = fn_lock(&task_service, &task_key, duration.as_millis() as u64).await? else {
283289
continue;
284290
};
285-
if !Self::check_when(&task, &owner, &task_service).await.unwrap() {
291+
if !Self::check_when(&task, &owner, &task_service).await? {
286292
continue;
287293
}
288294
fn_new_task_run(&task_service, &task).await?;
@@ -540,8 +546,7 @@ impl TaskService {
540546
};
541547
let result = task_service
542548
.execute_sql(Some(user.clone()), &format!("SELECT {when_condition}"))
543-
.await
544-
.unwrap();
549+
.await?;
545550
Ok(result
546551
.first()
547552
.and_then(|block| block.get_by_offset(0).index(0))

src/query/sql/src/planner/binder/ddl/task.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ impl Binder {
123123
sql,
124124
session_parameters,
125125
} = stmt;
126-
if (schedule_opts.is_none() && after.is_empty())
127-
|| (schedule_opts.is_some() && !after.is_empty())
128-
{
126+
if schedule_opts.is_some() && !after.is_empty() {
129127
return Err(ErrorCode::SyntaxException(
130128
"task must be defined with either given time schedule as a root task or run after other task as a DAG".to_string(),
131129
));
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#!/bin/bash
2+
# Copyright 2022 The Databend Authors.
3+
# SPDX-License-Identifier: Apache-2.0.
4+
5+
set -e
6+
7+
SCRIPT_PATH="$(cd "$(dirname "$0")" >/dev/null 2>&1 && pwd)"
8+
cd "$SCRIPT_PATH/../../" || exit
9+
10+
killall -9 databend-query || true
11+
killall -9 databend-meta || true
12+
rm -rf .databend
13+
14+
# enable private task
15+
CONFIG_FILE="./scripts/ci/deploy/config/databend-query-node-system-managed.toml"
16+
cat ./tests/task/private_task.toml >> "$CONFIG_FILE"
17+
18+
echo "Starting Databend Query cluster enable private task"
19+
./scripts/ci/deploy/databend-query-system-managed.sh 2
20+
21+
response=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"CREATE WAREHOUSE wh1 WITH WAREHOUSE_SIZE = '1'\"}")
22+
echo $response
23+
create_warehouse_1_query_id=$(echo $response | jq -r '.id')
24+
echo "Create WareHouse 1 Query ID: $create_warehouse_1_query_id"
25+
26+
response=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"CREATE WAREHOUSE wh2 WITH WAREHOUSE_SIZE = '1'\"}")
27+
echo $response
28+
create_warehouse_2_query_id=$(echo $response | jq -r '.id')
29+
echo "Create WareHouse 2 Query ID: $create_warehouse_2_query_id"
30+
31+
response=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"CREATE TABLE t1 (c1 int)\"}")
32+
echo $response
33+
create_table_query_id=$(echo $response | jq -r '.id')
34+
echo "Create Table Query ID: $create_table_query_id"
35+
36+
response=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"CREATE TASK my_task_1 WAREHOUSE = 'wh1' SCHEDULE = 3 SECOND AS insert into t1 values(1)\"}")
37+
echo $response
38+
create_task_1_query_id=$(echo $response | jq -r '.id')
39+
echo "Create Task 1 Query ID: $create_task_1_query_id"
40+
41+
response=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"CREATE TASK my_task_2 WAREHOUSE = 'wh2' SCHEDULE = 3 SECOND AS insert into t1 values(2)\"}")
42+
echo $response
43+
create_task_2_query_id=$(echo $response | jq -r '.id')
44+
echo "Create Task 2 ID: $create_task_2_query_id"
45+
46+
sleep 2
47+
48+
response=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"ALTER TASK my_task_1 RESUME\"}")
49+
echo $response
50+
resume_task_1_query_id=$(echo $response | jq -r '.id')
51+
echo "RESUME Task 1 ID: $resume_task_1_query_id"
52+
53+
response=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"ALTER TASK my_task_2 RESUME\"}")
54+
echo $response
55+
resume_task_2_query_id=$(echo $response | jq -r '.id')
56+
echo "RESUME Task 2 ID: $resume_task_2_query_id"
57+
58+
sleep 5
59+
60+
response=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"SELECT c1 FROM t1 ORDER BY c1\"}")
61+
echo $response
62+
63+
actual=$(echo "$response" | jq -c '.data')
64+
expected='[["1"],["2"]]'
65+
66+
if [ "$actual" = "$expected" ]; then
67+
echo "✅ Query result matches expected"
68+
else
69+
echo "❌ Mismatch"
70+
echo "Expected: $expected"
71+
echo "Actual : $actual"
72+
exit 1
73+
fi
74+
75+
response=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"SUSPEND WAREHOUSE wh2\"}")
76+
echo $response
77+
suspend_warehouse_2_query_id=$(echo $response | jq -r '.id')
78+
echo "Suspend WareHouse 2 Query ID: $suspend_warehouse_2_query_id"
79+
80+
sleep 4
81+
82+
response=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'X-DATABEND-WAREHOUSE: wh1' -H 'Content-Type: application/json' -d "{\"sql\": \"SELECT c1 FROM t1 ORDER BY c1\"}")
83+
echo $response
84+
85+
actual=$(echo "$response" | jq -c '.data')
86+
expected='[["1"],["1"],["2"]]'
87+
88+
if [ "$actual" = "$expected" ]; then
89+
echo "✅ Query result matches expected"
90+
else
91+
echo "❌ Mismatch"
92+
echo "Expected: $expected"
93+
echo "Actual : $actual"
94+
exit 1
95+
fi

tests/task/test-private-task.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ response=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-
6161
create_table_query_id=$(echo $response | jq -r '.id')
6262
echo "Create Table Query ID: $create_table_query_id"
6363

64-
response1=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"CREATE TASK my_task_1 WAREHOUSE = 'mywh' SCHEDULE = 1 SECOND AS insert into t1 values(0)\"}")
64+
response1=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"CREATE TASK my_task_1 SCHEDULE = 1 SECOND AS insert into t1 values(0)\"}")
6565
create_task_1_query_id=$(echo $response1 | jq -r '.id')
6666
echo "Create Task 1 Query ID: $create_task_1_query_id"
6767

68-
response2=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"CREATE TASK my_task_2 WAREHOUSE = 'mywh' SCHEDULE = 5 SECOND AS insert into t1 values(1)\"}")
68+
response2=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"CREATE TASK my_task_2 SCHEDULE = 5 SECOND AS insert into t1 values(1)\"}")
6969
create_task_2_query_id=$(echo $response2 | jq -r '.id')
7070
echo "Create Task 2 ID: $create_task_2_query_id"
7171

72-
response3=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"CREATE TASK my_task_3 WAREHOUSE = 'mywh' AFTER 'my_task_1', 'my_task_2' AS insert into t1 values(2)\"}")
72+
response3=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"CREATE TASK my_task_3 AFTER 'my_task_1', 'my_task_2' AS insert into t1 values(2)\"}")
7373
create_task_3_query_id=$(echo $response3 | jq -r '.id')
7474
echo "Create Task 3 ID: $create_task_3_query_id"
7575

@@ -234,7 +234,7 @@ response15=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Conten
234234
create_table_query_id_1=$(echo $response15 | jq -r '.id')
235235
echo "Create Table Query ID: $create_table_query_id_1"
236236

237-
response16=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"CREATE TASK my_task_4 WAREHOUSE = 'mywh' SCHEDULE = USING CRON '*/5 * * * * ?' AS insert into t2 values(0)\"}")
237+
response16=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"CREATE TASK my_task_4 SCHEDULE = USING CRON '*/5 * * * * ?' AS insert into t2 values(0)\"}")
238238
create_task_4_query_id=$(echo $response16 | jq -r '.id')
239239
echo "Create Task 4 Query ID: $create_task_4_query_id"
240240

@@ -274,15 +274,15 @@ response20=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Conten
274274
create_table_query_id_2=$(echo $response20 | jq -r '.id')
275275
echo "Create Table Query ID: $create_table_query_id_2"
276276

277-
response21=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"CREATE TASK my_task_5 WAREHOUSE = 'mywh' SCHEDULE = 3 SECOND WHEN EXISTS (SELECT 1 FROM t3 WHERE c2 = 1) AS insert into t3 values(1, 0)\"}")
277+
response21=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"CREATE TASK my_task_5 SCHEDULE = 3 SECOND WHEN EXISTS (SELECT 1 FROM t3 WHERE c2 = 1) AS insert into t3 values(1, 0)\"}")
278278
create_task_5_query_id=$(echo $response21 | jq -r '.id')
279279
echo "Create Task 5 Query ID: $create_task_5_query_id"
280280

281-
response22=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"CREATE TASK my_task_6 WAREHOUSE = 'mywh' SCHEDULE = 5 SECOND WHEN EXISTS (SELECT 1 FROM t3 WHERE c2 = 1) AS insert into t3 values(2, 0)\"}")
281+
response22=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"CREATE TASK my_task_6 SCHEDULE = 5 SECOND WHEN EXISTS (SELECT 1 FROM t3 WHERE c2 = 1) AS insert into t3 values(2, 0)\"}")
282282
create_task_6_query_id=$(echo $response22 | jq -r '.id')
283283
echo "Create Task 6 Query ID: $create_task_6_query_id"
284284

285-
response23=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"CREATE TASK my_task_7 WAREHOUSE = 'mywh' AFTER 'my_task_5', 'my_task_6' WHEN EXISTS (SELECT 1 FROM t3 WHERE c2 = 2) AS insert into t3 values(3, 0)\"}")
285+
response23=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-Type: application/json' -d "{\"sql\": \"CREATE TASK my_task_7 AFTER 'my_task_5', 'my_task_6' WHEN EXISTS (SELECT 1 FROM t3 WHERE c2 = 2) AS insert into t3 values(3, 0)\"}")
286286
create_task_7_query_id=$(echo $response23 | jq -r '.id')
287287
echo "Create Task 7 Query ID: $create_task_7_query_id"
288288

0 commit comments

Comments
 (0)