{"record":{"id":"ba5391644a4eecfb","repo":"risingwavelabs/risingwave","slug":"invalid-statement-type-for-alter-alter-target","errorCode":null,"errorMessage":"invalid statement type for alter {alter_target}: {:?}","messagePattern":"invalid statement type for alter (.+?): (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/frontend/src/handler/alter_utils.rs","lineNumber":101,"sourceCode":"\n            if !source.info.is_shared() {\n                bail_invalid_input_syntax!(\n                    \"cannot alter {alter_target} of non-shared source.\\n\\\n                     Use `ALTER MATERIALIZED VIEW` to alter the materialized view using the source instead.\"\n                );\n            }\n\n            session.check_privilege_for_drop_alter(schema_name, &**source)?;\n            source.id.as_share_source_job_id()\n        }\n        StatementType::ALTER_SINK => {\n            let (sink, schema_name) =\n                reader.get_any_sink_by_name(db_name, schema_path, &real_table_name)?;\n\n            session.check_privilege_for_drop_alter(schema_name, &**sink)?;\n            sink.id.as_job_id()\n        }\n        _ => bail!(\n            \"invalid statement type for alter {alter_target}: {:?}\",\n            alter_stmt_type\n        ),\n    };\n\n    Ok(job_id)\n}\n","sourceCodeStart":83,"sourceCodeEnd":109,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/frontend/src/handler/alter_utils.rs#L83-L109","documentation":"resolve_streaming_job_id_for_alter only handles certain ALTER statement types (e.g. ALTER MATERIALIZED VIEW, ALTER SINK, ALTER TABLE) to resolve the streaming job id. Reaching the catch-all arm means the statement type is not a valid target for this alter operation, so it bails with the target and statement type.","triggerScenarios":"Calling ALTER ... PARALLELISM / BACKFILL PARALLELISM / RESOURCE GROUP / SET CONFIG on a statement type not accepted, e.g. ALTER INDEX ... SET PARALLELISM, or mismatched statement routing.","commonSituations":"Users issuing parallelism or resource-group changes against objects (indexes, sources) that don't support them; SQL parsers accepting syntax for objects the resolver doesn't handle.","solutions":["Issue the alter against a supported object (materialized view, sink, table/index-backed streaming job)","Check the statement type in your SQL and target a streaming job that exists","Upgrade RisingWave if the object type should be supported in newer versions"],"exampleFix":"-- before\nALTER INDEX idx SET PARALLELISM 4; -- invalid target\n-- after\nALTER MATERIALIZED VIEW mv SET PARALLELISM 4;","handlingStrategy":"validation","validationCode":"-- Verify the object is a streaming job before altering parallelism\nSELECT name FROM rw_catalog.rw_materialized_views WHERE name = 'mv_name';","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only issue parallelism/resource-group alters on MVs, tables, or sinks","Check rw_catalog for object type before ALTER","Validate SQL against supported ALTER targets in docs"],"tags":["frontend","ddl","alter","invalid-target"],"backgroundTag":"unsupported-operation","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}