From 6a7b879a8c9c4b9b1e9c9b762f1abe972d495fef Mon Sep 17 00:00:00 2001 From: Shashank Suman Date: Fri, 10 Nov 2023 03:48:22 -0500 Subject: [PATCH 1/3] added doc for create job --- docs/source/reference/evaql/create_job.rst | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 docs/source/reference/evaql/create_job.rst diff --git a/docs/source/reference/evaql/create_job.rst b/docs/source/reference/evaql/create_job.rst new file mode 100644 index 0000000000..04949e1be0 --- /dev/null +++ b/docs/source/reference/evaql/create_job.rst @@ -0,0 +1,40 @@ +CREATE JOB +=============== + +.. _create-function: + +The CREATE JOB statement allows us to create recurring or one-time jobs in EvaDB. These jobs can be associated with multiple queries, +all of which will be executed sequentially every time the created job is triggered according to the assigned schedule. + + +.. code-block:: sql + + CREATE JOB [IF NOT EXISTS] AS { + ... + } + [START ] + [END ] + [EVERY ] + +* There can be multiple queries defined per job. +* The START parameter denotes the first trigger time of the job. The default value is the job creation time. +* The END parameter denotes the last trigger time of the job. The job becomes inactive after this time. If no end value is provided, a recurring job never ends. +* The EVERY parameter can be used to specify the repeat frequency of the jobs. The repeat period is expected to be a positive integer, and accepted values for the repeat unit are "minute", "minutes", "min", "hour", "hours", "day", "days", "week", "weeks", "month", "months". + + +Examples +~~~~~~~~ + +.. code:: text + + CREATE JOB forecasting_job AS { + CREATE OR REPLACE FUNCTION HomeSalesForecast FROM + ( SELECT * FROM postgres_data.home_sales ) + TYPE Forecasting + PREDICT 'price'; + SELECT HomeSalesForecast(10); + } + START '2023-04-01 01:10:00' + END '2023-05-01' + EVERY 1 week; + From 94fc7520614f6750955ce254ed65d804f5ccc647 Mon Sep 17 00:00:00 2001 From: Shashank Suman Date: Fri, 10 Nov 2023 03:53:17 -0500 Subject: [PATCH 2/3] added drop job doc --- docs/source/reference/evaql/drop_job.rst | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 docs/source/reference/evaql/drop_job.rst diff --git a/docs/source/reference/evaql/drop_job.rst b/docs/source/reference/evaql/drop_job.rst new file mode 100644 index 0000000000..fd0c920152 --- /dev/null +++ b/docs/source/reference/evaql/drop_job.rst @@ -0,0 +1,9 @@ +DROP JOB +============= + +.. _drop_job: + +.. code:: mysql + + DROP JOB forecasting_job; + DROP JOB IF EXISTS forecasting_job; \ No newline at end of file From fb510111741ed67f494464810bf43d7c5957db17 Mon Sep 17 00:00:00 2001 From: Shashank Suman Date: Fri, 17 Nov 2023 13:13:41 -0500 Subject: [PATCH 3/3] reformatting of headers --- docs/_toc.yml | 2 ++ docs/source/reference/evaql/create_job.rst | 11 ++++++----- docs/source/reference/evaql/drop_job.rst | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/_toc.yml b/docs/_toc.yml index ca191ce42d..1bf242808f 100644 --- a/docs/_toc.yml +++ b/docs/_toc.yml @@ -55,9 +55,11 @@ parts: - file: source/reference/evaql/create_function - file: source/reference/evaql/create_index - file: source/reference/evaql/create_table + - file: source/reference/evaql/create_job - file: source/reference/evaql/drop_database - file: source/reference/evaql/drop_function - file: source/reference/evaql/drop_table + - file: source/reference/evaql/drop_job - file: source/reference/evaql/insert_table - file: source/reference/evaql/delete_table - file: source/reference/evaql/rename diff --git a/docs/source/reference/evaql/create_job.rst b/docs/source/reference/evaql/create_job.rst index 04949e1be0..db24480396 100644 --- a/docs/source/reference/evaql/create_job.rst +++ b/docs/source/reference/evaql/create_job.rst @@ -1,15 +1,16 @@ CREATE JOB =============== -.. _create-function: +.. _create-job: The CREATE JOB statement allows us to create recurring or one-time jobs in EvaDB. These jobs can be associated with multiple queries, all of which will be executed sequentially every time the created job is triggered according to the assigned schedule. -.. code-block:: sql +.. code-block:: text - CREATE JOB [IF NOT EXISTS] AS { + CREATE JOB [IF NOT EXISTS] AS + { ... } [START ] @@ -27,7 +28,8 @@ Examples .. code:: text - CREATE JOB forecasting_job AS { + CREATE JOB forecasting_job AS + { CREATE OR REPLACE FUNCTION HomeSalesForecast FROM ( SELECT * FROM postgres_data.home_sales ) TYPE Forecasting @@ -37,4 +39,3 @@ Examples START '2023-04-01 01:10:00' END '2023-05-01' EVERY 1 week; - diff --git a/docs/source/reference/evaql/drop_job.rst b/docs/source/reference/evaql/drop_job.rst index fd0c920152..88910ca214 100644 --- a/docs/source/reference/evaql/drop_job.rst +++ b/docs/source/reference/evaql/drop_job.rst @@ -1,9 +1,9 @@ DROP JOB ============= -.. _drop_job: +.. _drop-job: .. code:: mysql DROP JOB forecasting_job; - DROP JOB IF EXISTS forecasting_job; \ No newline at end of file + DROP JOB IF EXISTS forecasting_job;