Repository navigation
Commit 32e9ec1
LAV-2760: Support ALTER TASK schedule and config properties (#3193)
* LAV-2760: support task schedule and config mutations
Persist ALTER TASK schedule/config changes in the task catalog, validate Cloud-captured value and graph rules, expose them through metadata/DDL, and let scheduler polls consume altered hour/cron schedules.
Co-authored-by: Sabir Akhadov <sabir.akhadov@localstack.cloud>
## Test matrix
interval seconds/minutes/hours × valid boundaries -> tests/queries/test_tasks.py::test_alter_task_schedule_config_value_spaces
cron expression/timezone × valid and invalid paths -> tests/queries/test_tasks.py::test_alter_task_schedule_config_value_spaces
CONFIG JSON object/non-object × valid and invalid paths -> tests/queries/test_tasks.py::test_alter_task_schedule_config_value_spaces
root started/suspended × SET/UNSET -> tests/queries/test_tasks.py::test_alter_task_schedule_config_state_and_predecessor_rules
predecessor task × SET/UNSET -> tests/queries/test_tasks.py::test_alter_task_schedule_config_state_and_predecessor_rules
missing task × IF EXISTS/plain -> tests/queries/test_tasks.py::test_alter_task_schedule_config_missing
SET/UNSET × SHOW/DESCRIBE/GET_DDL -> tests/queries/test_tasks.py::test_alter_task_schedule_config_set_unset_round_trip
interval-to-cron alteration × later scheduler poll -> tests/queries/test_tasks.py::test_scheduler_observes_altered_task_schedule
## Deviations
Extended the vendored CREATE TASK AST with CONFIG so GET_DDL output can parse and recreate the altered state; the hint only pointed at task DDL/catalog machinery but did not name the parser fork.
* LAV-2760: preserve legacy task catalog entry point
Keep the pre-CONFIG __snowflake$create_task signature as a forwarding overload for catalog migration and legacy-row compatibility.
Co-authored-by: Sabir Akhadov <sabir.akhadov@localstack.cloud>
## Test matrix
legacy task creation UDF × predecessor persistence -> tests/queries/test_tasks.py::test_task_legacy_predecessor_relations
## Deviations
Added a compatibility overload after the full task-file check exposed the existing direct catalog-UDF caller; this is an incidental compatibility fix required by the new CONFIG argument.
* LAV-2760: close task property parity gaps
Validate cron schedules before catalog persistence with the scheduler's parser plus Snowflake-specific day-of-week rules, accept Cloud-supported CONFIG quoting, safely emit CONFIG in GET_DDL, and prove recreated metadata and changed scheduler timing.\n\nSwept ALTER TASK schedule/config for the reviewer pattern: malformed/range/special cron fields, interval signs/decimals/overflow, timezone case and aliases, dollar/single quote CONFIG forms, combined UNSET, metadata round-trip, and stale scheduler timing are covered.\n\n## Test matrix\ninterval signed/decimal/overflow × valid/error -> tests/queries/test_tasks.py::test_alter_task_schedule_config_extended_value_spaces\ncron field bounds/names/ranges/lists/steps/L × valid/error -> tests/queries/test_tasks.py::test_alter_task_schedule_config_extended_value_spaces\ntimezone case/alias × valid -> tests/queries/test_tasks.py::test_alter_task_schedule_config_extended_value_spaces\nCONFIG dollar/single/apostrophe quoting × valid -> tests/queries/test_tasks.py::test_alter_task_schedule_config_extended_value_spaces\ncombined UNSET schedule/config × valid -> tests/queries/test_tasks.py::test_alter_task_schedule_config_extended_value_spaces\nSHOW CONFIG + GET_DDL apostrophe + recreate × valid -> tests/queries/test_tasks.py::test_alter_task_schedule_config_ddl_recreates_state\ninterval-to-cron × obsolete due time/later cron poll -> tests/queries/test_tasks.py::test_scheduler_altered_cron_replaces_interval_due_time
Co-authored-by: Sabir Akhadov <sabir.akhadov@localstack.cloud>
* LAV-2760: resolve task error carrier collision
Move schedule/config mutation carriers to an unused SQLSTATE range after merging main's sibling ALTER TASK property mappings.\n\n## Test matrix\nschedule/config errors × wire mapping -> tests/queries/test_tasks.py::test_alter_task_schedule_config_value_spaces\nextended interval/cron errors × wire mapping -> tests/queries/test_tasks.py::test_alter_task_schedule_config_extended_value_spaces
Co-authored-by: Sabir Akhadov <sabir.akhadov@localstack.cloud>
* LAV-2760: internalize task cron validator
Suppress the default pg_extern SQL declaration and register the Rust cron validator only as the internal __snowflake$valid_task_cron helper, so its native text/bool signature does not expand the public callable surface.
Swept the ALTER TASK schedule/config implementation for native-typed pg_extern helpers; valid_task_cron was the only instance and its call site now uses the internal name.
Co-authored-by: Sabir Akhadov <sabir.akhadov@localstack.cloud>
## Test matrix
cron schedule validation × accepted/error paths -> tests/queries/test_tasks.py::test_alter_task_schedule_config_extended_value_spaces
cron validator SQL surface × internal namespace only -> generated extension SQL and pg_proc catalog inspection
* LAV-2760: collapse task catalog compatibility overload
Keep the legacy 19-argument task catalog call compatible through a trailing defaulted CONFIG argument, while routing new CREATE TASK calls through the same single catalog function. This removes the multi-overload internal function that tripped the global any/null overload gate without exempting it.
Swept the task catalog SQL surface for the overload-gate pattern; __snowflake$create_task was the only new multi-overload helper and now has one signature.
Co-authored-by: Sabir Akhadov <sabir.akhadov@localstack.cloud>
## Test matrix
legacy CREATE TASK catalog call × omitted CONFIG -> tests/queries/test_tasks.py::test_task_legacy_predecessor_relations
CREATE TASK with CONFIG × DDL recreate -> tests/queries/test_tasks.py::test_alter_task_schedule_config_ddl_recreates_state
internal task helper × overload policy -> tests/queries/functions/test_overload_gate.py::test_every_multi_overload_function_carries_any_and_null
---------
Co-authored-by: spiral <spiral@localhost>
Co-authored-by: Sabir Akhadov <sabir.akhadov@localstack.cloud>1 parent d5ab3ec commit 32e9ec1
3 files changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5235 | 5235 | | |
5236 | 5236 | | |
5237 | 5237 | | |
| 5238 | + | |
| 5239 | + | |
5238 | 5240 | | |
5239 | 5241 | | |
5240 | 5242 | | |
| |||
8768 | 8770 | | |
8769 | 8771 | | |
8770 | 8772 | | |
| 8773 | + | |
8771 | 8774 | | |
8772 | 8775 | | |
8773 | 8776 | | |
| |||
8791 | 8794 | | |
8792 | 8795 | | |
8793 | 8796 | | |
| 8797 | + | |
| 8798 | + | |
| 8799 | + | |
8794 | 8800 | | |
8795 | 8801 | | |
8796 | 8802 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| 279 | + | |
279 | 280 | | |
280 | 281 | | |
281 | 282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6033 | 6033 | | |
6034 | 6034 | | |
6035 | 6035 | | |
| 6036 | + | |
6036 | 6037 | | |
6037 | 6038 | | |
6038 | 6039 | | |
| |||
6052 | 6053 | | |
6053 | 6054 | | |
6054 | 6055 | | |
| 6056 | + | |
6055 | 6057 | | |
6056 | 6058 | | |
6057 | 6059 | | |
| |||
6070 | 6072 | | |
6071 | 6073 | | |
6072 | 6074 | | |
| 6075 | + | |
| 6076 | + | |
| 6077 | + | |
6073 | 6078 | | |
6074 | 6079 | | |
6075 | 6080 | | |
| |||
6097 | 6102 | | |
6098 | 6103 | | |
6099 | 6104 | | |
6100 | | - | |
| 6105 | + | |
6101 | 6106 | | |
6102 | 6107 | | |
6103 | 6108 | | |
| |||
0 commit comments