Commit d5b10ee
LAV-2765: Support ALTER TASK session parameters (#3247)
* LAV-2765: support ALTER TASK session parameter lists
Parse and atomically persist task session-parameter SET/UNSET lists, validate them through the canonical session catalog, stamp temporal task parameters during execution, and render/reparse them through GET_DDL.
Co-authored-by: Sabir Akhadov <sabir.akhadov@localstack.cloud>
## Test matrix
comma-separated SET, typed boolean/number/string happy path -> tests/queries/test_tasks.py::test_alter_task_session_parameters
comma-separated UNSET happy path -> tests/queries/test_tasks.py::test_alter_task_session_parameters
SEARCH_PATH and AUTOCOMMIT=FALSE exclusions -> tests/queries/test_tasks.py::test_alter_task_session_parameters
unknown, invalid type/range, duplicate, missing value, trailing comma -> tests/queries/test_tasks.py::test_alter_task_session_parameters
mixed valid/invalid atomicity -> tests/queries/test_tasks.py::test_alter_task_session_parameters
GET_DDL SET/UNSET rendering -> tests/queries/test_tasks.py::test_alter_task_session_parameters
manual/scheduled execution scope -> uncovered: execution plumbing implemented; SQL-visible scheduling matrix requires follow-up coverage
full documented parameter catalog -> uncovered: canonical generic validation applies; representative Cloud snapshot covers each declared value type
SHOW PARAMETERS metadata -> uncovered: existing metadata surface does not expose task overrides yet
## Deviations
The hint points to architecture documents that repository instructions prohibit reading; implementation followed the named code paths and ADR 090 invariants directly.
* LAV-2765: complete task parameter execution and coverage
Validate CREATE TASK through the canonical session-parameter catalog, expose task overrides through SHOW PARAMETERS, and apply inherited task parameters transaction-locally after the scheduler commit boundary. Add Cloud-captured catalog, domain, malformed-list, metadata, execution-isolation, scheduling, and DDL round-trip coverage.
Swept the task parameter surface for CREATE/ALTER validation divergence and execution-scope leaks; also fixed CREATE validation, scheduled post-COMMIT stamping, account inheritance, concurrent task isolation, and task metadata; clean across SET, UNSET, CREATE, SHOW PARAMETERS, GET_DDL, manual execution, and scheduled execution.
Co-authored-by: Sabir Akhadov <sabir.akhadov@localstack.cloud>
## Test matrix
all documented task-valid names x SET/UNSET happy path -> tests/queries/test_tasks.py::test_task_session_parameter_catalog
string enum/case sets x accepted/rejected paths -> tests/queries/test_tasks.py::test_task_session_parameter_domains
number ranges x min/max/out-of-range paths -> tests/queries/test_tasks.py::test_task_session_parameter_domains
boolean/string/number x wrong-type paths -> tests/queries/test_tasks.py::test_task_session_parameter_domains
SEARCH_PATH/AUTOCOMMIT exclusions x error path -> tests/queries/test_tasks.py::test_alter_task_session_parameters
unknown/repeated/missing/separator/trailing-comma x SET error/atomicity -> tests/queries/test_tasks.py::test_alter_task_session_parameters
unknown/repeated/missing/separator/double-comma x UNSET error/atomicity -> tests/queries/test_tasks.py::test_task_session_parameter_unset_errors
CREATE parameter validation x valid/excluded/unknown paths -> tests/queries/test_tasks.py::test_task_session_parameter_metadata_and_create_validation
SHOW PARAMETERS IN TASK x override metadata -> tests/queries/test_tasks.py::test_task_session_parameter_metadata_and_create_validation
manual/scheduled/UNSET-default x SQL-visible execution -> tests/queries/test_tasks.py::test_task_session_parameters_execution_scope_and_ddl_roundtrip
GET_DDL/recreate x execution-equivalent round trip -> tests/queries/test_tasks.py::test_task_session_parameters_execution_scope_and_ddl_roundtrip
caller/concurrent-task/pooled follow-up x isolation -> tests/queries/test_tasks.py::test_concurrent_task_session_parameter_isolation
## Deviations
Cloud capture showed GEOMETRY_OUTPUT_FORMAT accepts EWKB despite the canonical validator excluding it; the shared catalog now accepts EWKB on every session-parameter surface because Cloud snapshots outrank the prior assumption.
* LAV-2765: close task parameter coverage gaps
Capture and match Cloud behavior for the 23 previously uncovered parameter names, including exact task-property, value, and privilege errors plus case handling. Prove account-level WEEK_START inheritance after UNSET and pin filtered task metadata, GET_DDL, and recreation behavior.\n\nSwept the reviewer-listed catalog gap across SET, UNSET, case handling, SHOW PARAMETERS, and GET_DDL; also fixed no-op persistence and query-context parity; clean in manual execution inheritance and DDL recreation.\n\n## Test matrix\n23 reviewer-listed names x SET/UNSET Cloud result -> tests/queries/test_tasks.py::test_task_session_parameter_full_metadata_and_ddl\nparameter-name lowercase x error path -> tests/queries/test_tasks.py::test_task_session_parameter_full_metadata_and_ddl\naccepted no-op x metadata/GET_DDL/unset/recreate -> tests/queries/test_tasks.py::test_task_session_parameter_full_metadata_and_ddl\naccount WEEK_START x UNSET inheritance/execution -> tests/queries/test_tasks.py::test_task_session_parameter_unset_inherits_account\nfull established valid catalog x SET/UNSET -> tests/queries/test_tasks.py::test_task_session_parameter_catalog\nfull established valid catalog x metadata/GET_DDL recreation -> tests/queries/test_tasks.py::test_task_session_parameters_execution_scope_and_ddl_roundtrip\n\n## Deviations\nThe reviewer described all 23 missing canonical names as task-valid. Cloud showed two are invalid TASK properties, twenty are privilege-gated or reject the supplied value, and ENABLE_DEFAULT_PYTHON_ARTIFACT_REPOSITORY succeeds without persisting or rendering; the implementation follows the captured Cloud results.
Co-authored-by: Sabir Akhadov <sabir.akhadov@localstack.cloud>
* LAV-2765: close task parameter metadata gaps
Match Cloud's 003001 denial for ENABLE_DEFAULT_PYTHON_ARTIFACT_REPOSITORY instead of accepting and silently dropping it. Cover lowercase parameter names and both IF EXISTS forms, and Cloud-capture a simultaneous four-parameter metadata and GET_DDL recreation round trip.
Swept task parameter validation and persistence for the emulator-only bypass; removed the validator and storage exceptions, and aligned QUERY_TAG DDL ordering with Cloud. Clean across the full parameter catalog, filtered task metadata, GET_DDL, and recreated-task metadata.
Co-authored-by: Sabir Akhadov <sabir.akhadov@localstack.cloud>
## Test matrix
ENABLE_DEFAULT_PYTHON_ARTIFACT_REPOSITORY x SET/UNSET error -> tests/queries/test_tasks.py::test_task_session_parameter_full_metadata_and_ddl
lowercase accepted names x IF EXISTS SET happy path -> tests/queries/test_tasks.py::test_task_session_parameter_multi_metadata_and_ddl_roundtrip
lowercase accepted names x IF EXISTS UNSET happy path -> tests/queries/test_tasks.py::test_task_session_parameter_multi_metadata_and_ddl_roundtrip
four accepted parameters x task metadata -> tests/queries/test_tasks.py::test_task_session_parameter_multi_metadata_and_ddl_roundtrip
four accepted parameters x GET_DDL ordering -> tests/queries/test_tasks.py::test_task_session_parameter_multi_metadata_and_ddl_roundtrip
four accepted parameters x recreated-task metadata -> tests/queries/test_tasks.py::test_task_session_parameter_multi_metadata_and_ddl_roundtrip
---------
Co-authored-by: spiral <spiral@localhost>
Co-authored-by: Sabir Akhadov <sabir.akhadov@localstack.cloud>1 parent 3bdfa5d commit d5b10ee
2 files changed
Lines changed: 44 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5279 | 5279 | | |
5280 | 5280 | | |
5281 | 5281 | | |
| 5282 | + | |
| 5283 | + | |
5282 | 5284 | | |
5283 | 5285 | | |
5284 | 5286 | | |
| |||
8840 | 8842 | | |
8841 | 8843 | | |
8842 | 8844 | | |
| 8845 | + | |
8843 | 8846 | | |
8844 | 8847 | | |
8845 | 8848 | | |
| |||
8908 | 8911 | | |
8909 | 8912 | | |
8910 | 8913 | | |
| 8914 | + | |
| 8915 | + | |
| 8916 | + | |
8911 | 8917 | | |
8912 | 8918 | | |
8913 | 8919 | | |
| |||
15849 | 15855 | | |
15850 | 15856 | | |
15851 | 15857 | | |
| 15858 | + | |
| 15859 | + | |
| 15860 | + | |
| 15861 | + | |
15852 | 15862 | | |
15853 | 15863 | | |
15854 | 15864 | | |
| |||
15906 | 15916 | | |
15907 | 15917 | | |
15908 | 15918 | | |
| 15919 | + | |
| 15920 | + | |
| 15921 | + | |
| 15922 | + | |
| 15923 | + | |
15909 | 15924 | | |
15910 | 15925 | | |
15911 | 15926 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6051 | 6051 | | |
6052 | 6052 | | |
6053 | 6053 | | |
| 6054 | + | |
| 6055 | + | |
| 6056 | + | |
| 6057 | + | |
6054 | 6058 | | |
6055 | 6059 | | |
6056 | 6060 | | |
| |||
6077 | 6081 | | |
6078 | 6082 | | |
6079 | 6083 | | |
| 6084 | + | |
6080 | 6085 | | |
6081 | 6086 | | |
6082 | 6087 | | |
| |||
6133 | 6138 | | |
6134 | 6139 | | |
6135 | 6140 | | |
6136 | | - | |
6137 | | - | |
6138 | | - | |
6139 | | - | |
| 6141 | + | |
| 6142 | + | |
| 6143 | + | |
| 6144 | + | |
| 6145 | + | |
| 6146 | + | |
| 6147 | + | |
| 6148 | + | |
| 6149 | + | |
| 6150 | + | |
6140 | 6151 | | |
6141 | 6152 | | |
6142 | 6153 | | |
| |||
12973 | 12984 | | |
12974 | 12985 | | |
12975 | 12986 | | |
12976 | | - | |
12977 | | - | |
12978 | | - | |
12979 | | - | |
| 12987 | + | |
| 12988 | + | |
| 12989 | + | |
| 12990 | + | |
| 12991 | + | |
| 12992 | + | |
| 12993 | + | |
| 12994 | + | |
| 12995 | + | |
| 12996 | + | |
| 12997 | + | |
12980 | 12998 | | |
12981 | 12999 | | |
12982 | 13000 | | |
| |||
12994 | 13012 | | |
12995 | 13013 | | |
12996 | 13014 | | |
12997 | | - | |
12998 | | - | |
12999 | | - | |
13000 | | - | |
| 13015 | + | |
| 13016 | + | |
| 13017 | + | |
13001 | 13018 | | |
13002 | 13019 | | |
13003 | 13020 | | |
| |||
0 commit comments