{"record":{"id":"ef911b1d82117190","repo":"prestodb/presto","slug":"not-found-ef911b","errorCode":"NOT_FOUND","errorMessage":"Table '%s' not found","messagePattern":"Table '(.+?)' not found","errorType":"error_code","errorClass":"TableNotFoundException","httpStatus":404,"severity":"error","filePath":"presto-mongodb/src/main/java/com/facebook/presto/mongodb/MongoSession.java","lineNumber":399,"sourceCode":"        return documentOf(NOT_EQ_OP, null);\n    }\n\n    // Internal Schema management\n    private Document getTableMetadata(SchemaTableName schemaTableName)\n            throws TableNotFoundException\n    {\n        String schemaName = schemaTableName.getSchemaName();\n        String tableName = schemaTableName.getTableName();\n\n        MongoDatabase db = client.getDatabase(schemaName);\n        MongoCollection<Document> schema = db.getCollection(schemaCollection);\n\n        Document doc = schema\n                .find(new Document(TABLE_NAME_KEY, tableName)).first();\n\n        if (doc == null) {\n            if (!collectionExists(db, tableName)) {\n                throw new TableNotFoundException(schemaTableName);\n            }\n            else {\n                Document metadata = new Document(TABLE_NAME_KEY, tableName);\n                metadata.append(FIELDS_KEY, guessTableFields(schemaTableName));\n                metadata.append(TYPE_KEY, guessTableType(schemaName, tableName));\n\n                schema.createIndex(new Document(TABLE_NAME_KEY, 1), new IndexOptions().unique(true));\n                schema.insertOne(metadata);\n\n                return metadata;\n            }\n        }\n\n        return doc;\n    }\n\n    public boolean collectionExists(MongoDatabase db, String collectionName)\n    {","sourceCodeStart":381,"sourceCodeEnd":417,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-mongodb/src/main/java/com/facebook/presto/mongodb/MongoSession.java#L381-L417","documentation":"MongoDB connector error from getTableMetadata: no schema-metadata document with the given table name was found in the schema collection for the database. The %s names the missing table; raised while reading table metadata or column definitions for a table the connector does not know.","triggerScenarios":"Thrown at presto-mongodb/src/main/java/com/facebook/presto/mongodb/MongoSession.java:399 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the table exists and is registered in the schema collection (use the mongodb sync tool / CREATE TABLE)","Check schema and table name spelling and case","Re-create the table definition in Presto pointing at the collection"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}