risingwavelabs/risingwave · error · SinkError::LanceDb
LanceDB sink does not support schema change
Error message
LanceDB sink does not support schema change
What it means
The LanceDB sink's pre_commit explicitly rejects any sink schema change request. RisingWave allows sinks to receive schema-change events, but the LanceDB implementation has not implemented schema evolution, so any non-null schema_change is refused with this error instead of being silently ignored.
Source
Thrown at src/connector/src/sink/lancedb.rs:721
#[async_trait::async_trait]
impl TwoPhaseCommitCoordinator for LanceDbSinkCommitter {
async fn init(&mut self) -> Result<()> {
tracing::info!(
"LanceDB commit coordinator initialized for table '{}'",
self.config.common.table
);
Ok(())
}
async fn pre_commit(
&mut self,
epoch: u64,
metadata: Vec<SinkMetadata>,
schema_change: Option<PbSinkSchemaChange>,
) -> Result<Option<Vec<u8>>> {
if schema_change.is_some() {
return Err(SinkError::LanceDb(anyhow!(
"LanceDB sink does not support schema change"
)));
}
let fragments = Self::collect_fragments(&metadata)?;
if fragments.is_empty() {
return Ok(None);
}
Ok(Some(
LanceDbPreCommitMetadata {
sink_id: self.sink_id.clone(),
epoch,
fragments,
}
.try_into_bytes()?,
))
}View on GitHub (pinned to 6469eb736d)
Solutions
- Do not alter the upstream source/MV schema while a LanceDB sink depends on it; drop and recreate the sink after the change
- Drop the sink, perform the schema change, then recreate the LanceDB sink so it plans against the new schema
- Check whether your RisingWave version has added LanceDB schema-evolution support and upgrade
Example fix
// before ALTER TABLE mv ADD COLUMN new_col INT; -- errors: sink does not support schema change // after DROP SINK lancedb_sink; ALTER TABLE mv ADD COLUMN new_col INT; CREATE SINK lancedb_sink AS SELECT ... INTO lancedb_table ...;
Defensive patterns
Strategy: validation
Validate before calling
-- before altering an upstream table feeding a LanceDB sink SELECT sink_name FROM rw_catalog.rw_sinks WHERE sink_from = '<upstream_table>'; -- drop/recreate these sinks first
Type guard
fn schema_change_supported(sink_type: &str) -> bool {
sink_type != "lancedb"
} Try / catch
match alter_result {
Err(err) if err.to_string().contains("does not support schema change") => {
// drop sink, alter, recreate sink
}
other => other,
} Prevention
- Plan schema evolution: drop and recreate LanceDB sinks around any ALTER on upstream sources/MVs
- Check sink documentation for schema-change support before relying on schema evolution
- Keep sink DDL in migration scripts so it is always recreated with the current schema
When it happens
Trigger: pre_commit is invoked with a non-null PbSinkSchemaChange — i.e., the source or materialized table feeding the sink undergoes a schema change (ALTER ADD/DROP COLUMN, type change) while the LanceDB sink is running.
Common situations: Developer ALTERs an upstream MV or source column after creating a LanceDB sink; automated schema evolution on a streaming job whose downstream sink is LanceDB.
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
- Only AddColumns schema change is supported for Snowflake sin
- Snowflake catalog only supports iceberg sources
- failed to get underlying lance Dataset (table may be remote)
- Lance fragment write task stopped before accepting a record
- LanceDB pre-commit epoch {} does not match commit epoch {}
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/8aeb9cc1ce87b294.
Report an issue: GitHub.