{"record":{"id":"9453786cc4e21753","repo":"risingwavelabs/risingwave","slug":"failed-to-get-underlying-lance-dataset-table-may","errorCode":null,"errorMessage":"failed to get underlying lance Dataset (table may be remote)","messagePattern":"failed to get underlying lance Dataset \\(table may be remote\\)","errorType":"exception","errorClass":"SinkError::LanceDb","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/lancedb.rs","lineNumber":110,"sourceCode":"            .execute()\n            .await\n            .context(\"failed to connect to LanceDB\")\n            .map_err(SinkError::LanceDb)?;\n        Ok(conn)\n    }\n\n    async fn open_table(&self, conn: &LanceDbConnection) -> Result<LanceDbTable> {\n        conn.open_table(&self.table)\n            .execute()\n            .await\n            .context(\"failed to open LanceDB table\")\n            .map_err(SinkError::LanceDb)\n    }\n\n    /// Get the Lance dataset URI from the opened native `LanceDB` table.\n    async fn dataset_uri(&self, table: &LanceDbTable) -> Result<String> {\n        let dataset_wrapper = table.dataset().ok_or_else(|| {\n            SinkError::LanceDb(anyhow!(\n                \"failed to get underlying lance Dataset (table may be remote)\"\n            ))\n        })?;\n        let dataset_guard = dataset_wrapper\n            .get()\n            .await\n            .map_err(|e| SinkError::LanceDb(anyhow!(e)))?;\n        Ok(dataset_guard.uri().to_owned())\n    }\n}\n\n#[serde_as]\n#[derive(Clone, Debug, Deserialize, WithOptions)]\npub struct LanceDbConfig {\n    #[serde(flatten)]\n    pub common: LanceDbCommon,\n\n    pub r#type: String,","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/lancedb.rs#L92-L128","documentation":"The LanceDB sink resolves the underlying Lance dataset URI from the opened table to run compaction/optimization. Only locally-opened native tables expose a Dataset; remote tables (opened via a remote LanceDB server) return None from table.dataset(), so the sink cannot proceed and errors.","triggerScenarios":"`dataset_uri(table)` called with a table opened against a remote LanceDB instance, where `table.dataset()` returns None.","commonSituations":"Connecting to LanceDB via a remote URI (db://... server connection) while the sink expects a local/native table path; trying to run table optimization on remote tables.","solutions":["Use a local/native LanceDB table path for the sink (not a remote server URI)","Skip dataset optimization for remote tables (they are managed by the remote server)","If remote support is needed, use the LanceDB server-side optimization APIs instead of operating on the local Dataset"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"// before using the sink against remote tables, check connectivity mode\nif table_uri.starts_with(\"db://\") {\n  return Err(\"local Lance dataset optimization not supported for remote tables\".into());\n}","typeGuard":"fn has_local_dataset(t: &LanceDbTable) -> bool {\n  t.dataset().is_some()\n}\n// call site: if !has_local_dataset(&table) { skip optimization }","tryCatchPattern":"match sink.dataset_uri(&table).await {\n  Err(e) if e.to_string().contains(\"table may be remote\") => {\n    warn!(\"skipping dataset optimization for remote LanceDB table\");\n    Ok(())\n  }\n  r => r,\n}","preventionTips":["Use local file/object-storage paths for LanceDB sink tables","Skip compaction/optimization steps when connected via remote db:// URIs","Confirm table.dataset() is Some before invoking dataset-dependent APIs"],"tags":["lancedb","dataset","remote-table","unsupported"],"backgroundTag":"unsupported-operation","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"}