{"record":{"id":"51678831f96d9a2d","repo":"risingwavelabs/risingwave","slug":"register-table-is-not-supported-in-mock-catalog","errorCode":null,"errorMessage":"register_table is not supported in mock catalog","messagePattern":"register_table is not supported in mock catalog","errorType":"exception","errorClass":"iceberg::Error (ErrorKind::Unexpected)","httpStatus":null,"severity":"warning","filePath":"src/connector/src/connector_common/iceberg/mock_catalog.rs","lineNumber":264,"sourceCode":"    async fn rename_table(&self, _src: &TableIdent, _dest: &TableIdent) -> iceberg::Result<()> {\n        todo!()\n    }\n\n    /// Update a table to the catalog.\n    async fn update_table(&self, _commit: TableCommit) -> iceberg::Result<Table> {\n        todo!()\n    }\n\n    #[expect(\n        clippy::disallowed_types,\n        reason = \"iceberg catalog trait requires returning iceberg::Error\"\n    )]\n    async fn register_table(\n        &self,\n        _table_ident: &TableIdent,\n        _metadata_location: String,\n    ) -> iceberg::Result<Table> {\n        Err(iceberg::Error::new(\n            iceberg::ErrorKind::Unexpected,\n            \"register_table is not supported in mock catalog\",\n        ))\n    }\n}\n","sourceCodeStart":246,"sourceCodeEnd":270,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/connector_common/iceberg/mock_catalog.rs#L246-L270","documentation":"register_table explicitly returns iceberg::Error with ErrorKind::Unexpected and the message \"register_table is not supported in mock catalog\". Unlike the other stubs it is a deliberate, catchable error rather than a panic, signaling that registering an existing metadata file is outside the mock's scope.","triggerScenarios":"Calling register_table(ident, metadata_location) on MockIcebergCatalog.","commonSituations":"Testing recovery/registration flows that attach an existing Iceberg table by metadata location; generic trait-exercising test harnesses.","solutions":["Do not test register_table against this mock; use a real catalog","Change the error to ErrorKind::FeatureUnsupported if callers branch on error kind","Implement the stub to return a fixture Table if registration behavior is needed in tests"],"exampleFix":"// before\nErr(iceberg::Error::new(\n    iceberg::ErrorKind::Unexpected,\n    \"register_table is not supported in mock catalog\",\n))\n// after\nErr(iceberg::Error::new(\n    iceberg::ErrorKind::FeatureUnsupported,\n    \"register_table is not supported in mock catalog\",\n))","handlingStrategy":"try-catch","validationCode":"// register_table is explicitly unsupported; check capability before calling\nif is_mock_catalog(&catalog) { return Err(anyhow!(\"register_table unsupported\")); }","typeGuard":"fn supports_register(c: &dyn Catalog) -> bool { /* MockIcebergCatalog -> false */ false }","tryCatchPattern":"match catalog.register_table(&ident, metadata_location).await {\n    Err(e) if e.message().contains(\"not supported in mock catalog\") => {\n        // fall back to load_table or skip the test\n    }\n    other => other?,\n}","preventionTips":["Do not test metadata-file registration against the mock","Branch on the explicit error rather than assuming success","Use a real REST/SQL catalog for register_table coverage","Consider ErrorKind::FeatureUnsupported so callers can match reliably"],"tags":["rust","test-mock","iceberg"],"backgroundTag":"operation-not-supported","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"}