risingwavelabs/risingwave · error
invalid statement type for alter {alter_target}: {:?}
Error message
invalid statement type for alter {alter_target}: {:?} What it means
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.
Source
Thrown at src/frontend/src/handler/alter_utils.rs:101
if !source.info.is_shared() {
bail_invalid_input_syntax!(
"cannot alter {alter_target} of non-shared source.\n\
Use `ALTER MATERIALIZED VIEW` to alter the materialized view using the source instead."
);
}
session.check_privilege_for_drop_alter(schema_name, &**source)?;
source.id.as_share_source_job_id()
}
StatementType::ALTER_SINK => {
let (sink, schema_name) =
reader.get_any_sink_by_name(db_name, schema_path, &real_table_name)?;
session.check_privilege_for_drop_alter(schema_name, &**sink)?;
sink.id.as_job_id()
}
_ => bail!(
"invalid statement type for alter {alter_target}: {:?}",
alter_stmt_type
),
};
Ok(job_id)
}
View on GitHub (pinned to 6469eb736d)
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
Example fix
-- before ALTER INDEX idx SET PARALLELISM 4; -- invalid target -- after ALTER MATERIALIZED VIEW mv SET PARALLELISM 4;
Defensive patterns
Strategy: validation
Validate before calling
-- Verify the object is a streaming job before altering parallelism SELECT name FROM rw_catalog.rw_materialized_views WHERE name = 'mv_name';
Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- {object_type} named {name} already exists{}
- Unsupported throttle target: {:?} and throttle type: {:?}
- failed to drop column "{}" because it's referenced by a gene
- Field '{field}' is not allowed to be altered on the fly for
- relative_error={} does not satisfy 0.0 < relative_error < 1.
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/ba5391644a4eecfb.
Report an issue: GitHub.