{"record":{"id":"d1ae6bfb5434bfd8","repo":"risingwavelabs/risingwave","slug":"unsupported-to-query-directly-from-this-source","errorCode":null,"errorMessage":"Unsupported to query directly from this {} source, please create a table or streaming job from it","messagePattern":"Unsupported to query directly from this (.+?) source, please create a table or streaming job from it","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/frontend/src/scheduler/plan_fragmenter.rs","lineNumber":475,"sourceCode":"\n                Ok(SourceScanInfo::Complete(res))\n            }\n            (ConnectorProperties::BatchPosixFs(prop), SourceFetchParameters::Empty) => {\n                use risingwave_connector::source::SplitEnumerator;\n                let mut enumerator = BatchPosixFsEnumerator::new(\n                    *prop,\n                    risingwave_connector::source::SourceEnumeratorContext::dummy().into(),\n                )\n                .await?;\n                let splits = enumerator.list_splits().await?;\n                let res = splits\n                    .into_iter()\n                    .map(SplitImpl::BatchPosixFs)\n                    .collect_vec();\n\n                Ok(SourceScanInfo::Complete(res))\n            }\n            (connector, _) => Err(SchedulerError::Internal(anyhow!(\n                \"Unsupported to query directly from this {} source, \\\n                 please create a table or streaming job from it\",\n                connector.kind()\n            ))),\n        }\n    }\n}\n\n#[derive(Clone, Debug)]\npub struct TableScanInfo {\n    /// The name of the table to scan.\n    name: String,\n\n    /// Indicates the table partitions to be read by scan tasks. Unnecessary partitions are already\n    /// pruned.\n    ///\n    /// For singleton table, this field is still `Some` and only contains a single partition with\n    /// full vnode bitmap, since we need to know where to schedule the singleton scan task.","sourceCodeStart":457,"sourceCodeEnd":493,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/frontend/src/scheduler/plan_fragmenter.rs#L457-L493","documentation":"`SourceScanInfo::complete` (src/frontend/src/scheduler/plan_fragmenter.rs:475) rejects batch queries that scan a source connector directly. Only sources with partitionable batch split support (e.g. Kafka with offsets, Iceberg/Posix FS files) can be queried in batch mode; other connector kinds must first be materialized into a table or streaming job.","triggerScenarios":"Running `SELECT * FROM <source>` where `<source>` is a connector source whose kind has no batch split implementation (the catch-all `(connector, _)` match arm).","commonSituations":"Querying directly from CDC or other non-batch-queryable sources created with `CREATE SOURCE`, expecting ad-hoc SELECT to work like it does on tables or MVs.","solutions":["Create a table or materialized view over the source (`CREATE MATERIALIZED VIEW mv AS SELECT * FROM source;`) and query that.","Use `CREATE TABLE ... WITH (connector=...)` to ingest into a table, then SELECT from the table.","If the connector should support batch queries, verify the source kind string is correct (e.g. `kafka`, `iceberg`) or add a split implementation for the kind."],"exampleFix":"// before: SELECT * FROM my_cdc_source;  -- fails\n// after\nCREATE MATERIALIZED VIEW mv_cdc AS SELECT * FROM my_cdc_source;\nSELECT * FROM mv_cdc;","handlingStrategy":"validation","validationCode":"-- Only query tables/MVs, or sources with batch split support\nSELECT name, connector FROM rw_catalog.rw_sources WHERE name = 'my_source';\n-- if connector is not batch-queryable (e.g. cdc), query a MV over it instead","typeGuard":null,"tryCatchPattern":"match scheduler_result {\n    Err(e) if e.to_string().contains(\"Unsupported to query directly\") => {\n        eprintln!(\"Create a materialized view over the source before querying it.\");\n    }\n    r => r?,\n}","preventionTips":["Materialize sources into tables/MVs before ad-hoc SELECTs.","Remember only Kafka/Iceberg/FS-style sources support direct batch queries.","Validate source kind before enabling direct query paths in tools."],"tags":["scheduler","source","batch-query"],"backgroundTag":"incompatible-source-type","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"}