This is a prerelease version.

View latest

CREATE JOB

The CREATE JOB statement submits a job to Hazelcast to run independently of the SQL client. With this statement, you can run a 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.

See some practical examples.

CREATE JOB [IF NOT EXISTS] job_name
[ OPTIONS ( 'option_name' = 'option_value' [, ...] ) ]
AS query_spec

Parameters

The CREATE JOB statement accepts the following parameters.

job_name and query_spec 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. A job must use an INSERT INTO/SINK INTO query because pipelines are only valid with at least one sink.

option_name, option_value

See Configuring Jobs for available parameters. Note that userCodeNamespace is not supported.

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