risingwavelabs/risingwave · error · NotSupported

system table has no unaligned_join

Error message

system table has no unaligned_join

What it means

ALTER STREAMING ENABLE UNALIGNED JOIN can only be applied to stream jobs that have a sync log store job id (materialized views, sinks, tables, shared sources). System tables (e.g. pg_* / rw_* internal catalogs) are not streaming jobs, so the handler bails with a NotSupported error before touching the meta client. The library throws it to prevent meaningless ALTER calls on read-only catalog relations.

Solutions

  1. Target a materialized view, sink, table, or shared source instead of a system table.
  2. Fully qualify the object name (e.g. my_schema.my_mv) so search_path does not resolve it to a system catalog.
  3. Filter system/catalog relations out of any batch script before issuing the ALTER.

Example fix

// before
ALTER STREAMING ENABLE UNALIGNED JOIN pg_catalog.pg_tables;
// after
ALTER STREAMING ENABLE UNALIGNED JOIN my_schema.my_mv;
Defensive patterns

Strategy: validation

Validate before calling

-- Check the relation type before altering:
SELECT relation_type FROM rw_catalog.rw_relations WHERE name = 'my_rel';
-- Only proceed if relation_type IN ('materialized-view','sink','table');
-- System tables live in pg_catalog / rw_catalog and must be excluded.

Type guard

// Rust-side narrowing before invoking the handler
fn is_alterable(relation: &Relation) -> bool {
    matches!(relation, Relation::Source(s) if s.is_shared())
        || matches!(relation, Relation::BaseTable(_))
}

Prevention

When it happens

Trigger: Running `ALTER STREAMING ... ENABLE|DISABLE UNALIGNED JOIN` naming a system table such as `pg_catalog.pg_tables` or any `rw_*` internal catalog relation, which binds to Relation::SystemTable in handle_alter_streaming_enable_unaligned_join.

Common situations: Scripts that iterate over all relations in a schema (including system catalogs) and blindly apply the ALTER; autocomplete or ORM-generated DDL that resolved an unqualified name to a system table; typos that accidentally match a catalog name in a search_path.

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


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/8f0707e8168ee8a1. Report an issue: GitHub.

Appendix: source

Thrown at src/frontend/src/handler/alter_streaming_enable_unaligned_join.rs:50

            let mut binder = Binder::new_for_system(&session);
            Binder::validate_cross_db_reference(&session.database(), &name)?;
            let not_found_err = CatalogError::not_found("stream job", name.to_string());

            if let Ok(relation) = binder.bind_catalog_relation_by_object_name(&name, true) {
                match relation {
                    Relation::Source(s) => {
                        if s.is_shared() {
                            s.catalog.id.as_share_source_job_id()
                        } else {
                            bail!(ErrorCode::NotSupported(
                                "source has no unaligned_join".to_owned(),
                                "Please only target materialized views or sinks".to_owned(),
                            ));
                        }
                    }
                    Relation::BaseTable(t) => t.table_catalog.id.as_job_id(),
                    Relation::SystemTable(_t) => {
                        bail!(ErrorCode::NotSupported(
                            "system table has no unaligned_join".to_owned(),
                            "Please only target materialized views or sinks".to_owned(),
                        ));
                    }
                    Relation::Share(_s) => {
                        bail!(ErrorCode::NotSupported(
                            "view has no unaligned_join".to_owned(),
                            "Please only target materialized views or sinks".to_owned(),
                        ));
                    }
                    _ => {
                        // Other relation types (Subquery, Join, etc.) are not directly describable.
                        return Err(not_found_err.into());
                    }
                }
            } else if let Ok(sink) = binder.bind_sink_by_name(name.clone()) {
                sink.sink_catalog.id.as_job_id()
            } else {

View on GitHub (pinned to 6469eb736d)