{"record":{"id":"ac59bd1810d823cc","repo":"risingwavelabs/risingwave","slug":"view-has-no-unaligned-join","errorCode":null,"errorMessage":"view has no unaligned_join","messagePattern":"view has no unaligned_join","errorType":"error_code","errorClass":"NotSupported","httpStatus":null,"severity":"error","filePath":"src/frontend/src/handler/alter_streaming_enable_unaligned_join.rs","lineNumber":56,"sourceCode":"                    Relation::Source(s) => {\n                        if s.is_shared() {\n                            s.catalog.id.as_share_source_job_id()\n                        } else {\n                            bail!(ErrorCode::NotSupported(\n                                \"source has no unaligned_join\".to_owned(),\n                                \"Please only target materialized views or sinks\".to_owned(),\n                            ));\n                        }\n                    }\n                    Relation::BaseTable(t) => t.table_catalog.id.as_job_id(),\n                    Relation::SystemTable(_t) => {\n                        bail!(ErrorCode::NotSupported(\n                            \"system table has no unaligned_join\".to_owned(),\n                            \"Please only target materialized views or sinks\".to_owned(),\n                        ));\n                    }\n                    Relation::Share(_s) => {\n                        bail!(ErrorCode::NotSupported(\n                            \"view has no unaligned_join\".to_owned(),\n                            \"Please only target materialized views or sinks\".to_owned(),\n                        ));\n                    }\n                    _ => {\n                        // Other relation types (Subquery, Join, etc.) are not directly describable.\n                        return Err(not_found_err.into());\n                    }\n                }\n            } else if let Ok(sink) = binder.bind_sink_by_name(name.clone()) {\n                sink.sink_catalog.id.as_job_id()\n            } else {\n                return Err(not_found_err.into());\n            }\n        };\n        let meta_client = session.env().meta_client();\n        meta_client\n            .set_sync_log_store_aligned(job_id, !enable)","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/frontend/src/handler/alter_streaming_enable_unaligned_join.rs#L38-L74","documentation":"The unaligned-join toggle only applies to relations backed by a stream job with a sync log store. Shares (shared relations referenced across databases) carry no such job, so the handler rejects them with a NotSupported error telling the user to target a materialized view or sink. (Note: the message says 'view' but the match arm is Relation::Share.)","triggerScenarios":"Running `ALTER STREAMING ... UNALIGNED JOIN` against a share object (a relation published via CREATE SHARE and bound as Relation::Share) in handle_alter_streaming_enable_unaligned_join.","commonSituations":"Developers working with cross-database/shared relation features attempt to tune the shared relation itself instead of the consumer materialized view or sink that actually runs the stream job.","solutions":["Apply the ALTER to the concrete materialized view or sink that consumes the share, not the share itself.","If tuning is needed at the source, alter the original relation in the database that owns it before sharing."],"exampleFix":"// before\nALTER STREAMING ENABLE UNALIGNED JOIN my_shared_mv;\n// after\nALTER STREAMING ENABLE UNALIGNED JOIN consumer_db.consumer_mv;","handlingStrategy":"validation","validationCode":"-- Resolve the object and reject shares before ALTER:\nSELECT relation_type FROM rw_catalog.rw_relations WHERE name = 'my_rel';\n-- Proceed only when relation_type IS NOT NULL (shares are not alterable jobs);\n-- prefer altering the concrete MV/sink that consumes the share.","typeGuard":"fn is_direct_stream_job(relation: &Relation) -> bool {\n    matches!(relation, Relation::BaseTable(_))\n        || matches!(relation, Relation::Source(s) if s.is_shared())\n}","tryCatchPattern":null,"preventionTips":["Never ALTER a share directly; alter the consuming MV or sink.","Check rw_relations for the object type before running DDL.","Document that unaligned_join applies to stream jobs, not shared catalog objects."],"tags":["risingwave","sql","not-supported","share"],"backgroundTag":"unsupported-operation","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}