{"record":{"id":"75e6350d0c44bec6","repo":"prestodb/presto","slug":"schema-s-not-found-75e635","errorCode":null,"errorMessage":"Schema %s not found","messagePattern":"Schema (.+?) not found","errorType":"exception","errorClass":"SchemaNotFoundException","httpStatus":404,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/procedure/UnregisterTableProcedure.java","lineNumber":77,"sourceCode":"                ImmutableList.of(\n                        new Argument(\"schema\", VARCHAR),\n                        new Argument(\"table_name\", VARCHAR)),\n                UNREGISTER_TABLE.bindTo(this));\n    }\n\n    public void unregisterTable(ConnectorSession clientSession, String schema, String table)\n    {\n        try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(getClass().getClassLoader())) {\n            doUnregisterTable(clientSession, schema, table);\n        }\n    }\n\n    private void doUnregisterTable(ConnectorSession clientSession, String schema, String table)\n    {\n        IcebergAbstractMetadata metadata = (IcebergAbstractMetadata) metadataFactory.create();\n        SchemaTableName schemaTableName = new SchemaTableName(schema, table);\n        if (!metadata.schemaExists(clientSession, schemaTableName.getSchemaName())) {\n            throw new SchemaNotFoundException(schemaTableName.getSchemaName());\n        }\n\n        metadata.unregisterTable(clientSession, schemaTableName);\n    }\n}\n","sourceCodeStart":59,"sourceCodeEnd":83,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/procedure/UnregisterTableProcedure.java#L59-L83","documentation":"UnregisterTableProcedure.doUnregisterTable first checks that the schema exists via metadata.schemaExists(). When the given schema name does not exist in the catalog, it throws SchemaNotFoundException (message 'Schema %s not found') instead of attempting to unregister a table under a nonexistent namespace.","triggerScenarios":"Calling the unregister_table system procedure with a schema name that has no matching schema in the Iceberg catalog, e.g. system.unregister_table(schema => 'typo_schema', table => 't').","commonSituations":"Typo in the schema name; schema dropped by someone else before the call; connecting to a different catalog/environment than intended (dev vs prod); case-sensitivity mismatches in identifiers.","solutions":["Verify the schema exists (SHOW SCHEMAS) and correct the schema name in the call","Confirm you are connected to the intended catalog/environment","If the schema was dropped, the table is already gone — no unregister needed","Recreate the schema first if the intent is to also keep a namespace for other tables"],"exampleFix":"// before\nCALL system.unregister_table(schema => 'sale', table => 'events'); -- schema 'sale' not found\n// after\nCALL system.unregister_table(schema => 'sales', table => 'events');","handlingStrategy":"validation","validationCode":"// before calling unregister_table\nSHOW SCHEMAS FROM iceberg_catalog LIKE 'myschema';\n-- proceed only if a row is returned","typeGuard":null,"tryCatchPattern":"try {\n    runUnregisterTable(schema, table);\n} catch (SchemaNotFoundException e) {\n    // schema (or table) already absent; treat as no-op or correct the name\n}","preventionTips":["Run SHOW SCHEMAS / SHOW TABLES to confirm identifiers before unregistering","Watch identifier case sensitivity in the catalog","Verify you are pointed at the intended catalog and environment"],"tags":["iceberg","schema-not-found","procedure-argument"],"backgroundTag":"schema-not-found","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}