{"record":{"id":"2210d58964f37fee","repo":"prestodb/presto","slug":"table-not-found-2210d5","errorCode":"TABLE_NOT_FOUND","errorMessage":"Table '${tableName}' not found","messagePattern":"Table '(.+?)' not found","errorType":"error_code","errorClass":"TableNotFoundException","httpStatus":null,"severity":"error","filePath":"presto-prometheus/src/main/java/com/facebook/presto/plugin/prometheus/PrometheusSplitManager.java","lineNumber":189,"sourceCode":"                        Duration.timeUnitToString(queryChunkSizeDuration.getUnit()) + \"]\")\n                .addParameter(\"time\", time)\n                .build();\n    }\n\n    @Override\n    public ConnectorSplitSource getSplits(\n            ConnectorTransactionHandle transactionHandle,\n            ConnectorSession session,\n            ConnectorTableLayoutHandle layout,\n            SplitSchedulingContext splitSchedulingContext)\n    {\n        PrometheusTableLayoutHandle layoutHandle = (PrometheusTableLayoutHandle) layout;\n        PrometheusTableHandle tableHandle = layoutHandle.getTableHandle();\n        PrometheusTable table = prometheusClient.getTable(tableHandle.getSchemaName(), tableHandle.getTableName());\n\n        // this can happen if table is removed during a query\n        if (table == null) {\n            throw new TableNotFoundException(tableHandle.toSchemaTableName());\n        }\n        List<ConnectorSplit> splits = generateTimesForSplits(prometheusClock.now(), maxQueryRangeDuration, queryChunkSizeDuration, tableHandle)\n                .stream()\n                .map(time -> {\n                    try {\n                        return new PrometheusSplit(buildQuery(\n                                prometheusURI,\n                                time,\n                                table.getName(),\n                                queryChunkSizeDuration));\n                    }\n                    catch (URISyntaxException e) {\n                        throw new PrestoException(PROMETHEUS_UNKNOWN_ERROR, \"split URI invalid: \" + e.getMessage());\n                    }\n                }).collect(Collectors.toList());\n        return new FixedSplitSource(splits);\n    }\n","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-prometheus/src/main/java/com/facebook/presto/plugin/prometheus/PrometheusSplitManager.java#L171-L207","documentation":"Split generation guard in PrometheusSplitManager.getSplits: the table (metric) referenced by the layout handle cannot be found in the Prometheus client's table metadata, so a not-found error naming the table is thrown. Commonly occurs when the metric is deleted or renamed while a query is executing.","triggerScenarios":"Thrown at presto-prometheus/src/main/java/com/facebook/presto/plugin/prometheus/PrometheusSplitManager.java:189 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the metric still exists in Prometheus","Re-issue the query; concurrent metric removal is transient","Check Prometheus scrape/target health for the metric series"],"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"}