Skip to content

Commit 2c0f9dc

Browse files
committed
really fix clickhouse tests
1 parent d667aae commit 2c0f9dc

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

internal-packages/clickhouse/src/taskRuns.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import {
55
getTaskRunsQueryBuilder,
66
insertRawTaskRunPayloadsCompactArrays,
77
insertTaskRunsCompactArrays,
8-
TASK_RUN_COLUMNS,
9-
PAYLOAD_COLUMNS,
108
type TaskRunInsertArray,
119
type PayloadInsertArray,
1210
} from "./taskRuns.js";

internal-packages/clickhouse/src/taskRuns.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,20 @@ export function insertTaskRunsCompactArrays(ch: ClickhouseWriter, settings?: Cli
180180
});
181181
}
182182

183+
// Object-based insert function for tests and non-performance-critical code
184+
export function insertTaskRuns(ch: ClickhouseWriter, settings?: ClickHouseSettings) {
185+
return ch.insert({
186+
name: "insertTaskRuns",
187+
table: "trigger_dev.task_runs_v2",
188+
schema: TaskRunV2,
189+
settings: {
190+
enable_json_type: 1,
191+
type_json_skip_duplicated_paths: 1,
192+
...settings,
193+
},
194+
});
195+
}
196+
183197
export const RawTaskRunPayloadV1 = z.object({
184198
run_id: z.string(),
185199
created_at: z.number().int(),
@@ -281,6 +295,24 @@ export function insertRawTaskRunPayloadsCompactArrays(
281295
});
282296
}
283297

298+
// Object-based insert function for tests and non-performance-critical code
299+
export function insertRawTaskRunPayloads(ch: ClickhouseWriter, settings?: ClickHouseSettings) {
300+
return ch.insert({
301+
name: "insertRawTaskRunPayloads",
302+
table: "trigger_dev.raw_task_runs_payload_v1",
303+
schema: RawTaskRunPayloadV1,
304+
settings: {
305+
async_insert: 1,
306+
wait_for_async_insert: 0,
307+
async_insert_max_data_size: "1000000",
308+
async_insert_busy_timeout_ms: 1000,
309+
enable_json_type: 1,
310+
type_json_skip_duplicated_paths: 1,
311+
...settings,
312+
},
313+
});
314+
}
315+
284316
export const TaskRunV2QueryResult = z.object({
285317
run_id: z.string(),
286318
});

0 commit comments

Comments
 (0)