This is a prerelease version.

CREATE JOB

The CREATE JOB statement submits a job to Hazelcast to run independently of the SQL client. With this statement, you can run an SQL statement in the background.

Syntax Summary

This code block is a quick reference with all the parameters that you can use with the CREATE JOB statement.

For some practical examples, see << examples, Code Examples>>.
CREATE JOB Synopsis
CREATE JOB [IF NOT EXISTS] job_name
[ OPTIONS ( 'option_name' = 'option_value' [, ...] ) ]
AS query_spec

Parameters

The CREATE JOB statement accepts the following parameters.

All these parameters are required.

Parameter Description Example

job_name

Unique name to identify the job. A name can be reused for other jobs only after the original job has completed or failed.

query_spec

The query for the job to run. Currently we support only INSERT INTO/SINK INTO queries. SELECT queries are not supported because they return the results to the client, which in the case of a job is not connected.

option_name, option_value

Examples

This section lists some example SQL queries that show you how to use the CREATE JOB statement.

Create a Job

CREATE JOB myJob
OPTIONS (
    'processingGuarantee' = 'exactlyOnce',
    'snapshotIntervalMillis' = '5000',
) AS
INSERT INTO myMap
SELECT * FROM my_source_topic