{"record":{"id":"4902c24084d256e1","repo":"risingwavelabs/risingwave","slug":"register-table-is-not-supported-by-jnicatalog","errorCode":null,"errorMessage":"register_table is not supported by JniCatalog","messagePattern":"register_table is not supported by JniCatalog","errorType":"exception","errorClass":"iceberg::Error (ErrorKind::Unexpected)","httpStatus":null,"severity":"error","filePath":"src/connector/src/connector_common/iceberg/jni_catalog.rs","lineNumber":439,"sourceCode":"                iceberg::ErrorKind::Unexpected,\n                \"Failed to drop iceberg table.\",\n            )\n            .with_source(e)\n        })\n    }\n\n    async fn purge_table(&self, table: &TableIdent) -> iceberg::Result<()> {\n        let table_info = self.load_table(table).await?;\n        self.drop_table(table).await?;\n        iceberg::drop_table_data(&table_info).await\n    }\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 by JniCatalog\",\n        ))\n    }\n\n    /// Check if a table exists in the catalog.\n    async fn table_exists(&self, table: &TableIdent) -> iceberg::Result<bool> {\n        let inner = self.inner.clone();\n        let table = table.clone();\n        execute_blocking_jni(move || {\n            execute_with_jni_env(inner.jvm, |env| {\n                let table_name_str = table.to_string();\n\n                let table_name_jstr = env.new_string(&table_name_str).unwrap();\n\n                let exists =\n                    call_method!(env, inner.java_catalog.as_obj(), {boolean tableExists(String)},\n                    &table_name_jstr)","sourceCodeStart":421,"sourceCodeEnd":457,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/connector_common/iceberg/jni_catalog.rs#L421-L457","documentation":"JniCatalog intentionally does not implement Catalog::register_table; any call immediately returns this Unexpected error. Registering an existing metadata location under a new identifier is not wired through the JNI bridge.","triggerScenarios":"Calling register_table on a JniCatalog handle — e.g. migrating a table by pointing an identifier at an existing metadata.json location, or code paths (recovery, re-registration) that use the generic Catalog trait against the JNI catalog.","commonSituations":"Framework code calling register_table as part of a generic iceberg catalog workflow while the configured catalog is a JniCatalog backend.","solutions":["Avoid register_table with a JniCatalog; use create_table/load_table flows instead","Route register_table operations to a catalog implementation that supports it (REST/Hive/Glue/Nessie)","If registration is required, extend JniCatalog with a JNI method exposing the Java catalog's registerTable and implement the trait method"],"exampleFix":"// before\nlet table = catalog.register_table(&ident, metadata_location).await?;\n// after (choose a supported path)\nlet table = catalog.create_table(&ns, schema, partition, location, props).await?;","handlingStrategy":"fallback","validationCode":"// Guard call sites: only invoke register_table on catalogs that support it\nfn supports_register(catalog: &dyn Catalog) -> bool { !is_jni_catalog(catalog) }","typeGuard":"fn is_jni_catalog(c: &dyn Any) -> bool { c.is::<JniCatalog>() }","tryCatchPattern":"match catalog.register_table(&ident, location).await {\n    Err(e) if e.message().contains(\"register_table is not supported\") => {\n        // fallback to create_table or a catalog that supports registration\n    }\n    other => other,\n}","preventionTips":["Document JniCatalog capability limits where catalogs are selected","Use REST/Hive/Glue catalogs when table registration is required","Add capability checks before calling optional trait methods"],"tags":["iceberg","jni","catalog","not-implemented"],"backgroundTag":"method-not-implemented","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"}