{"record":{"id":"89d853eafad7d987","repo":"risingwavelabs/risingwave","slug":"schema-conversion-error","errorCode":null,"errorMessage":"(schema conversion error)","messagePattern":"\\(schema conversion error\\)","errorType":"exception","errorClass":"SinkError::LanceDb","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/lancedb.rs","lineNumber":244,"sourceCode":"\n        // Validate connection\n        let conn = self.config.common.create_connection().await?;\n\n        // Validate table exists and schema is compatible\n        let table = self.config.common.open_table(&conn).await?;\n\n        // Get the Lance table schema (Arrow schema)\n        let lance_schema = table\n            .schema()\n            .await\n            .context(\"failed to get LanceDB table schema\")\n            .map_err(SinkError::LanceDb)?;\n\n        // Convert RW schema to arrow schema and compare\n        let rw_schema = self.param.schema();\n        let rw_arrow_schema = LanceDbConvert\n            .rw_schema_to_arrow_schema(&rw_schema)\n            .map_err(|e| SinkError::LanceDb(anyhow!(e)))?;\n\n        validate_ordered_schema(&rw_arrow_schema, lance_schema.as_ref())?;\n\n        Ok(())\n    }\n\n    fn is_coordinated_sink(&self) -> bool {\n        true\n    }\n\n    async fn new_coordinator(\n        &self,\n        _iceberg_compact_stat_sender: Option<UnboundedSender<IcebergSinkCompactionUpdate>>,\n    ) -> Result<SinkCommitCoordinator> {\n        let committer =\n            LanceDbSinkCommitter::new(self.config.clone(), self.param.sink_id.to_string()).await?;\n        if Self::is_exactly_once(&self.param.properties)? {\n            Ok(SinkCommitCoordinator::TwoPhase(Box::new(committer)))","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/lancedb.rs#L226-L262","documentation":"During sink validation, RisingWave converts its internal schema to an Arrow schema via LanceDbConvert::rw_schema_to_arrow_schema; if any RisingWave column type has no Arrow/Lance representation in the converter, the conversion fails and validation aborts.","triggerScenarios":"Creating a LanceDB sink whose source schema contains an RW data type unsupported by the LanceDB arrow conversion (e.g., certain struct/list/interval types).","commonSituations":"Sinking tables with exotic types (nested structs, map types, intervals) into LanceDB; after upgrading RW and adding new types not yet mapped in LanceDbConvert.","solutions":["Read the wrapped conversion message to identify the unsupported column/type","Change the offending column to a supported type (int, bigint, varchar, boolean, float, timestamp, etc.)","Cast unsupported columns to supported types in the sink's query (SELECT col::varchar ...)","Upgrade RisingWave in case support for the type was added later"],"exampleFix":"// before\nCREATE SINK s FROM mv_t WITH ('connector'='lancedb', ...); -- mv_t has INTERVAL column\n// after\nCREATE SINK s AS SELECT i::varchar AS i FROM mv_t WITH ('connector'='lancedb', ...);","handlingStrategy":"try-catch","validationCode":"// Validate column types before creating the sink\nconst supported = ['boolean','smallint','integer','bigint','real','double precision','varchar','timestamp','date','bytea'];\nfor (const col of sinkColumns)\n  if (!supported.includes(col.type)) throw new Error(`unsupported type on ${col.name}: ${col.type}`);","typeGuard":null,"tryCatchPattern":"catch (SinkError::LanceDb(e)) if e.to_string().contains(\"schema\") { adjust offending column type or cast it in the sink SELECT }","preventionTips":["Keep sink table schemas to plain scalar types","Cast nested/exotic types to varchar/jsonb before sinking","Check the LanceDB connector's supported-type list before designing the table"],"tags":["rust","arrow","schema"],"backgroundTag":"schema-validation-failed","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"}