SUBMIT TASK

Description

Submits an ETL statement as an asynchronous task.

Syntax

SUBMIT TASK [task_name] AS <etl_statement>

Parameters

ParameterDescription
task_nameThe task name.
etl_statementThe ETL statement that you want to submit as an asynchronous task. CelerData currently supports submitting asynchronous tasks for CREATE TABLE AS SELECT and INSERT.

Usage notes

You can check the status of asynchronous tasks by querying the metadata table task_runs in Information Schema.

SELECT * FROM information_schema.task_runs;
SELECT * FROM information_schema.task_runs WHERE task_name = '<task_name>';

Examples

Example 1: Submit an asynchronous task for CREATE TABLE tbl1 AS SELECT * FROM src_tbl, and specify the task name as etl0:

SUBMIT TASK etl0 AS CREATE TABLE tbl1 AS SELECT * FROM src_tbl;

Example 2: Submit an asynchronous task for INSERT INTO tbl2 SELECT * FROM src_tbl, and specify the task name as etl1:

SUBMIT TASK etl1 AS INSERT INTO tbl2 SELECT * FROM src_tbl;

Example 3: Submit an asynchronous task for INSERT OVERWRITE tbl3 SELECT * FROM src_tbl:

SUBMIT TASK AS INSERT OVERWRITE tbl3 SELECT * FROM src_tbl;

Example 4: Submit an asynchronous task for INSERT OVERWRITE insert_wiki_edit SELECT * FROM source_wiki_edit, and extend the query timeout to 100000 seconds using the hint:

SUBMIT /*+set_var(query_timeout=100000)*/ TASK AS
INSERT OVERWRITE insert_wiki_edit
SELECT * FROM source_wiki_edit;