risingwavelabs/risingwave · error

unsupported stream_scan_type for auto refresh schema: {:?}

Error message

unsupported stream_scan_type for auto refresh schema: {:?}

What it means

Auto schema refresh for sinks is only supported when the stream scan is an `ArrangementBackfill`. If the resolved StreamScan node's `stream_scan_type` is anything else (e.g. MView, IndexBackfill, SharedSource), this error is returned, aborting creation of the streaming job.

Source

Thrown at src/meta/src/stream/stream_graph/fragment.rs:444

        }
        _ => {
            return Err(anyhow!(
                "expect PbNodeBody::StreamScan or PbNodeBody::Project but got: {:?}",
                stream_input_node.node_body
            )
            .into());
        }
    };
    let PbNodeBody::StreamScan(scan) = stream_scan_node.node_body.as_ref().unwrap() else {
        return Err(anyhow!(
            "expect PbNodeBody::StreamScan but got: {:?}",
            stream_scan_node.node_body
        )
        .into());
    };
    let stream_scan_type = PbStreamScanType::try_from(scan.stream_scan_type).unwrap();
    if stream_scan_type != PbStreamScanType::ArrangementBackfill {
        return Err(anyhow!(
            "unsupported stream_scan_type for auto refresh schema: {:?}",
            stream_scan_type
        )
        .into());
    }
    let [merge_node, _batch_plan_node] = stream_scan_node.input.as_slice() else {
        panic!(
            "the number of StreamScan inputs is not 2: {:?}",
            stream_scan_node.input
        );
    };
    let NodeBody::Merge(_) = merge_node.node_body.as_ref().unwrap() else {
        return Err(anyhow!(
            "expect PbNodeBody::Merge but got: {:?}",
            merge_node.node_body
        )
        .into());
    };

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Create the sink over a plain table (with backfill) instead of a materialized view or index if auto schema refresh is required.
  2. Check the sink's upstream type with `SHOW` / catalog and confirm it uses arrangement backfill.
  3. Recreate the sink without expecting schema refresh, and handle schema changes manually (drop/recreate).
  4. Verify the feature flag / version supporting refresh schema is consistent across the cluster.

Example fix

-- before: sink over MV with auto schema refresh expectation
CREATE SINK s FROM mv_orders WITH (...);
-- after: sink over the base table arrangement backfill
CREATE SINK s FROM orders WITH (...);
Defensive patterns

Strategy: validation

Validate before calling

let scan_type = PbStreamScanType::try_from(scan.stream_scan_type)?;
if scan_type != PbStreamScanType::ArrangementBackfill {
    return Err("auto schema refresh requires ArrangementBackfill sink".into());
}

Type guard

fn is_arrangement_backfill(scan: &PbStreamScan) -> bool {
    PbStreamScanType::try_from(scan.stream_scan_type)
        .map(|t| t == PbStreamScanType::ArrangementBackfill)
        .unwrap_or(false)
}

Prevention

When it happens

Trigger: `generate_streaming_job` -> `check_sink_fragments_support_refresh_schema` with a StreamScan whose `stream_scan_type` != `PbStreamScanType::ArrangementBackfill`.

Common situations: Creating a sink whose upstream is a materialized view or index rather than a raw table with backfill, while expecting auto schema refresh to work; refreshing schema on sinks over sources; feature/flag differences between versions.

Related errors


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