{"record":{"id":"33a38375833486f2","repo":"databendlabs/databend","slug":"replace-with-streaming-not-supported-yet","errorCode":null,"errorMessage":"replace with streaming not supported yet","messagePattern":"replace with streaming not supported yet","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/query/service/src/interpreters/interpreter_replace.rs","lineNumber":451,"sourceCode":"                        copy_plan.stage_table_info.files_to_copy.unwrap_or_default(),\n                        copy_plan.stage_table_info.stage_info.clone(),\n                        copy_plan.stage_table_info.copy_into_table_options.clone(),\n                    ));\n                    Ok(ReplaceSourceCtx {\n                        root: physical_plan,\n                        select_ctx: None,\n                        update_stream_meta: vec![],\n                        bind_context: None,\n                    })\n                }\n                _ => unreachable!(\"plan in InsertInputSource::Stag must be CopyIntoTable\"),\n            },\n            #[cfg(not(feature = \"storage-stage\"))]\n            InsertInputSource::Stage(_) => Err(ErrorCode::Unimplemented(\n                \"Stage COPY source support is disabled, rebuild with cargo feature 'storage-stage'\",\n            )),\n            InsertInputSource::StreamingLoad { .. } => {\n                unreachable!(\"replace with streaming not supported yet\")\n            }\n        }\n    }\n\n    fn connect_value_source(\n        &self,\n        schema: DataSchemaRef,\n        source: &InsertValue,\n    ) -> Result<PhysicalPlan> {\n        Ok(PhysicalPlan::new(ReplaceAsyncSourcer {\n            schema,\n            source: source.clone(),\n            meta: PhysicalPlanMeta::new(\"ReplaceAsyncSourcer\"),\n        }))\n    }\n\n    #[async_backtrace::framed]\n    async fn connect_query_plan_source<'a>(","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/query/service/src/interpreters/interpreter_replace.rs#L433-L469","documentation":"The REPLACE interpreter does not support streaming-load input sources at all. If a REPLACE statement's input is InsertInputSource::StreamingLoad (the MySQL-style streaming insert channel), the code hits unreachable! and panics, because REPLACE requires a fully formed query or stage source instead of an inline stream.","triggerScenarios":"Issuing a REPLACE statement whose input plan comes through the streaming-load path (e.g. REPLACE INTO combined with a streaming write), rather than a SELECT/query or stage COPY source.","commonSituations":"Client drivers or connectors that stream row data inline attempting REPLACE; tools that generalize INSERT streaming logic to REPLACE statements.","solutions":["Rewrite the statement to REPLACE INTO ... SELECT ... from an existing table instead of streaming rows.","First INSERT-stream the rows into a staging table, then run REPLACE INTO target SELECT * FROM staging.","Use a driver/statement form that produces a query-based source for REPLACE."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"-- Rewrite streaming REPLACE into table-then-merge:\nINSERT INTO staging_table VALUES (...);\nREPLACE INTO target SELECT * FROM staging_table;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never issue REPLACE through a driver's streaming write channel","Document that REPLACE requires a query or stage source","Wrap streaming ingestion in an intermediate table"],"tags":["rust","unreachable","streaming-load","replace"],"backgroundTag":"unsupported-operation","analyzedSha":"288d84d76e20a2f8f7173bda9691eb6ece301aa9","analyzedAt":"2026-09-11T11:29:36.208Z","contentChangedAt":"2026-09-11T11:29:36.208Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}