{"record":{"id":"0c7b6ad2145129b3","repo":"prestodb/presto","slug":"not-found-0c7b6a","errorCode":"NOT_FOUND","errorMessage":"Schema %s does not exist","messagePattern":"Schema (.+?) does not exist","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/PinotMetadata.java","lineNumber":87,"sourceCode":"\n    private String getPinotTableNameFromPrestoTableName(ConnectorSession session, String prestoTableName)\n    {\n        List<String> allTables = pinotPrestoConnection.getTableNames();\n        String normalizedPrestoTableName = normalizeIdentifier(session, prestoTableName);\n        for (String pinotTableName : allTables) {\n            String normalizedPinotTableName = normalizeIdentifier(session, pinotTableName);\n            if (normalizedPrestoTableName.equals(normalizedPinotTableName)) {\n                return pinotTableName;\n            }\n        }\n        throw new PinotException(PINOT_UNCLASSIFIED_ERROR, Optional.empty(), \"Unable to find the presto table \" + prestoTableName + \" in \" + allTables);\n    }\n\n    @Override\n    public PinotTableHandle getTableHandle(ConnectorSession session, SchemaTableName tableName)\n    {\n        if (!SCHEMA_NAME.equals(normalizeIdentifier(session, tableName.getSchemaName()))) {\n            throw new PrestoException(NOT_FOUND, format(\"Schema %s does not exist\", tableName.getSchemaName()));\n        }\n        String pinotTableName = getPinotTableNameFromPrestoTableName(session, tableName.getTableName());\n        return new PinotTableHandle(connectorId, tableName.getSchemaName(), pinotTableName);\n    }\n\n    @Override\n    public ConnectorTableLayoutResult getTableLayoutForConstraint(\n            ConnectorSession session,\n            ConnectorTableHandle table,\n            Constraint<ColumnHandle> constraint,\n            Optional<Set<ColumnHandle>> desiredColumns)\n    {\n        // Constraint's don't need to be pushed down since they are already taken care off by the pushdown logic\n        PinotTableHandle pinotTableHandle = (PinotTableHandle) table;\n        ConnectorTableLayout layout = new ConnectorTableLayout(new PinotTableLayoutHandle(pinotTableHandle));\n        return new ConnectorTableLayoutResult(layout, constraint.getSummary());\n    }\n","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/PinotMetadata.java#L69-L105","documentation":"PinotMetadata.getTableHandle throws PrestoException NOT_FOUND when the requested schema name is not the connector's fixed schema ('default'). The Pinot connector only exposes one schema, so any other schema is reported as nonexistent to the engine.","triggerScenarios":"A query like SELECT * FROM pinot.myschema.mytable where myschema != SCHEMA_NAME (\"default\"), or a fully qualified reference using a wrong schema name.","commonSituations":"Copying SQL written for another connector (Postgres/MySQL) with a database/schema qualifier; tools generating schema-qualified names; catalog misused as schema name.","solutions":["Use the 'default' schema: SELECT * FROM pinot.default.mytable","Drop the schema qualifier entirely: SELECT * FROM mytable with the pinot catalog selected","Fix the SQL generator or BI tool to omit schema qualification for the Pinot catalog"],"exampleFix":"// before\nSELECT * FROM pinot.mydb.events\n// after\nSELECT * FROM pinot.default.events","handlingStrategy":"validation","validationCode":"// In client code, drop schema qualification for Pinot\nSchemaTableName name = new SchemaTableName(\"default\", tableName); // never anything else","typeGuard":null,"tryCatchPattern":"try {\n    connector.getTableHandle(session, schemaTableName);\n} catch (PrestoException e) {\n    if (e.getErrorCode() == NOT_FOUND.toErrorCode()) {\n        // rewrite query with schema 'default' before surfacing to user\n    }\n    throw e;\n}","preventionTips":["Always qualify Pinot tables as catalog.default.table in SQL","Update SQL generators/BI tools to omit custom schema names for Pinot","Document that the Pinot connector exposes a single 'default' schema","Add query linting that flags schema names other than 'default' on the pinot catalog"],"tags":["pinot","schema","not-found"],"backgroundTag":"schema-does-not-exist","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}