{"record":{"id":"95bafd9e6961f23c","repo":"prestodb/presto","slug":"missing-table-95bafd","errorCode":"MISSING_TABLE","errorMessage":"Source table '%s' does not exist","messagePattern":"Source table '(.+?)' does not exist","errorType":"error_code","errorClass":"SemanticException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java","lineNumber":1267,"sourceCode":"        {\n            analysis.setUpdateInfo(node.getUpdateInfo());\n            return createAndAssignScope(node, scope);\n        }\n\n        @Override\n        protected Scope visitCreateTable(CreateTable node, Optional<Scope> scope)\n        {\n            analysis.setUpdateInfo(node.getUpdateInfo());\n            validateProperties(node.getProperties(), scope);\n            return createAndAssignScope(node, scope);\n        }\n\n        @Override\n        protected Scope visitCreateVectorIndex(CreateVectorIndex node, Optional<Scope> scope)\n        {\n            QualifiedObjectName sourceTableName = createQualifiedObjectName(session, node, node.getTableName(), metadata);\n            if (!metadataResolver.tableExists(sourceTableName)) {\n                throw new SemanticException(MISSING_TABLE, node, \"Source table '%s' does not exist\", sourceTableName);\n            }\n\n            QualifiedObjectName targetTable = createQualifiedObjectName(session, node, node.getIndexName(), metadata);\n\n            // Analyze the source table to build a proper scope with typed columns\n            // Use AllowAllAccessControl since we check permissions separately below\n            StatementAnalyzer analyzer = new StatementAnalyzer(\n                    analysis,\n                    metadata,\n                    sqlParser,\n                    new AllowAllAccessControl(),\n                    session,\n                    warningCollector);\n\n            Table sourceTable = new Table(node.getTableName());\n            Scope tableScope = analyzer.analyze(sourceTable, scope);\n\n            // Check for duplicate columns","sourceCodeStart":1249,"sourceCodeEnd":1285,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java#L1249-L1285","documentation":"CREATE VECTOR INDEX requires the source table named in the statement to exist in the referenced catalog/schema. The analyzer resolves the qualified object name and checks the connector via metadataResolver.tableExists(); if the table is absent it raises MISSING_TABLE with the fully qualified name.","triggerScenarios":"CREATE VECTOR INDEX ... ON catalog.schema.table ... where the connector reports the source table does not exist (typo, wrong catalog/schema, table dropped, or no permissions visible to the resolver).","commonSituations":"Typo in table or schema name; running the statement connected to the wrong catalog; case-sensitivity mismatches; the table was dropped or renamed before index creation; missing connector configuration so the catalog resolves but is empty.","solutions":["Verify the table exists: SELECT * FROM system.jdbc.tables WHERE table_schem = '...' or run a DESCRIBE on it, and fix any typos.","Check you are connected to the correct catalog/schema (USE catalog.schema).","Confirm the table was not dropped/renamed and recreate it if needed.","Verify connector/catalog configuration and permissions if the table visibly exists elsewhere."],"exampleFix":"// before\nCREATE VECTOR INDEX idx ON analytics.doc_embeedings(col);\n// after\nCREATE VECTOR INDEX idx ON analytics.doc_embeddings(col);","handlingStrategy":"validation","validationCode":"boolean exists = (boolean) query(\"SELECT count(*) > 0 FROM system.jdbc.tables \" +\n    \"WHERE table_cat = ? AND table_schem = ? AND table_name = ?\",\n    catalog, schema, table).get(0).get(0);\nif (!exists) throw new IllegalArgumentException(\"Source table missing: \" + qualifiedName);","typeGuard":null,"tryCatchPattern":"try {\n    execute(createVectorIndexSql);\n} catch (SemanticException e) {\n    if (e.getCode() == MISSING_TABLE) {\n        throw new IllegalStateException(\"Create/verify the source table before CREATE VECTOR INDEX\", e);\n    }\n    throw e;\n}","preventionTips":["Run SHOW TABLES / DESCRIBE to confirm the source table right before index creation.","Fully qualify catalog.schema.table in deployment scripts and pin the catalog name in config.","Order DDL so the source table creation always precedes CREATE VECTOR INDEX."],"tags":["presto","vector-index","missing-table","semantic-analysis"],"backgroundTag":"table-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"}