Version: 6.0-SNAPSHOT
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.
sql
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. | Create a Job |
| query_spec | The query for the job to run. A job must use an INSERT INTO/ query because pipelines are only valid with at least one sink. | Create a Job |
| option_name, option_value | See Configuring Jobs for available parameters. Note that user is not supported. | Create a Job |
Examples
This section lists some example SQL queries that show you how to use the CREATE JOB statement.
Create a Job
sql
CREATE JOB myJob
OPTIONS (
'processingGuarantee' = 'exactlyOnce',
'snapshotIntervalMillis' = '5000',
) AS
INSERT INTO myMap
SELECT * FROM my_source