{"record":{"id":"d56f0b235606007f","repo":"prestodb/presto","slug":"not-found-d56f0b","errorCode":"NOT_FOUND","errorMessage":"Could not move to latest snapshot on table '%s.%s'","messagePattern":"Could not move to latest snapshot on table '(.+?)\\.(.+?)'","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-delta/src/main/java/com/facebook/presto/delta/DeltaClient.java","lineNumber":125,"sourceCode":"    {\n        // Fetch the snapshot info for given snapshot version. If no snapshot version is given, get the latest snapshot info.\n        // Lock the snapshot version here and use it later in the rest of the query (such as fetching file list etc.).\n        // If we don't lock the snapshot version here, the query may end up with schema from one version and data files from another\n        // version when the underlying delta table is changing while the query is running.\n        Snapshot snapshot;\n        if (snapshotId.isPresent()) {\n            snapshot = getSnapshotById(deltaTable, deltaEngine, snapshotId.get(), schemaTableName);\n        }\n        else if (snapshotAsOfTimestampMillis.isPresent()) {\n            snapshot = getSnapshotAsOfTimestamp(deltaTable, deltaEngine,\n                    snapshotAsOfTimestampMillis.get(), schemaTableName);\n        }\n        else {\n            try {\n                snapshot = deltaTable.getLatestSnapshot(deltaEngine); // get the latest snapshot\n            }\n            catch (TableNotFoundException e) {\n                throw new PrestoException(StandardErrorCode.NOT_FOUND,\n                        format(\"Could not move to latest snapshot on table '%s.%s'\", schemaTableName.getSchemaName(),\n                                schemaTableName.getTableName()), e);\n            }\n        }\n\n        if (snapshot instanceof SnapshotImpl) {\n            String format = ((SnapshotImpl) snapshot).getMetadata().getFormat().getProvider();\n            if (!PARQUET.name().equalsIgnoreCase(format)) {\n                throw new PrestoException(DeltaErrorCode.DELTA_UNSUPPORTED_DATA_FORMAT,\n                        format(\"Delta table %s has unsupported data format: %s. Only the Parquet data format is supported\", schemaTableName, format));\n            }\n        }\n        return snapshot;\n    }\n\n    /**\n     * Get the list of files corresponding to the given Delta table.\n     *","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-delta/src/main/java/com/facebook/presto/delta/DeltaClient.java#L107-L143","documentation":"DeltaClient.getSnapshot resolves the Delta table's snapshot; when no explicit snapshot version is requested it asks deltaTable.getLatestSnapshot(deltaEngine). If the Delta log cannot be found, the underlying delta library throws TableNotFoundException, which is wrapped as a PrestoException with StandardErrorCode.NOT_FOUND saying it could not move to the latest snapshot. This means the requested table has no valid Delta transaction log at the location being read.","triggerScenarios":"Calling snapshot() -> getSnapshot() on a schema-qualified table whose Delta log (_delta_log) is missing, deleted, or not yet written — deltaTable.getLatestSnapshot(deltaEngine) throws TableNotFoundException.","commonSituations":"Querying a path registered as a Delta table but actually not a Delta table (e.g. plain Parquet directory); table dropped or _delta_log removed; wrong location configured for the table in the metastore; typo in schema/table name; writing to the table before the first commit completes.","solutions":["Verify the table's location in the metastore actually contains a _delta_log directory; if it's plain Parquet, convert it (e.g. CONVERT TO DELTA) or register it correctly","Check schema and table names for typos and confirm the table exists in the Delta catalog","If the _delta_log was deleted, restore it from backups or checkpoint/recreate the table","Confirm the connector has read access to the table's storage location and the correct filesystem credentials"],"exampleFix":"-- before\nSELECT * FROM delta.schema1.table1; -- location points at plain Parquet\n-- after\nCONVERT TO DELTA parquet.`/path/to/table1`; -- or point the metastore at a real Delta table\nSELECT * FROM delta.schema1.table1;","handlingStrategy":"try-catch","validationCode":"// before querying: check the table's location actually has a Delta log\nPath tablePath = getTableLocation(schemaTableName); // from metastore\nPath deltaLog = new Path(tablePath, \"_delta_log\");\nif (!filesystem.exists(deltaLog)) {\n    throw new UserError(\"Location \" + tablePath + \" has no _delta_log; not a Delta table\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    Snapshot snapshot = deltaClient.getSnapshot(schemaTableName, snapshotId);\n} catch (PrestoException e) {\n    if (e.getErrorCode() == StandardErrorCode.NOT_FOUND.toErrorCodeCode()\n            && e.getMessage().contains(\"Could not move to latest snapshot\")) {\n        // verify schema/table name and that the location contains _delta_log\n        throw new TableNotDeltaException(schemaTableName);\n    }\n    throw e;\n}","preventionTips":["Verify locations registered in the metastore are real Delta tables (contain _delta_log) before querying","Guard against concurrent drop/overwrite of the table's transaction log","Watch for writes to a new table that have not made their first commit yet","Use CONVERT TO DELTA for plain Parquet directories instead of registering them as Delta"],"tags":["delta-lake","not-found","table","metadata"],"backgroundTag":"delta-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"}