{"record":{"id":"4e4508f172eb3b65","repo":"prestodb/presto","slug":"generic-internal-error-4e4508","errorCode":"GENERIC_INTERNAL_ERROR","errorMessage":"Explain format not supported: ","messagePattern":"Explain format not supported: ","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/operator/ExplainAnalyzeOperator.java","lineNumber":166,"sourceCode":"        }\n\n        QueryInfo queryInfo = queryPerformanceFetcher.getQueryInfo(operatorContext.getDriverContext().getTaskId().getQueryId());\n        checkState(queryInfo.getOutputStage().isPresent(), \"Output stage is missing\");\n        checkState(queryInfo.getOutputStage().get().getSubStages().size() == 1, \"Expected one sub stage of explain node\");\n\n        if (!hasFinalStageInfo(queryInfo.getOutputStage().get())) {\n            return null;\n        }\n        String plan;\n        switch (format) {\n            case TEXT:\n                plan = textDistributedPlan(queryInfo.getOutputStage().get().getSubStages().get(0), functionAndTypeManager, operatorContext.getSession(), verbose);\n                break;\n            case JSON:\n                plan = jsonDistributedPlan(queryInfo.getOutputStage().get().getSubStages().get(0), functionAndTypeManager, operatorContext.getSession());\n                break;\n            default:\n                throw new PrestoException(GENERIC_INTERNAL_ERROR, \"Explain format not supported: \" + format);\n        }\n\n        BlockBuilder builder = VARCHAR.createBlockBuilder(null, 1);\n        VARCHAR.writeString(builder, plan);\n\n        outputConsumed = true;\n        return new Page(builder.build());\n    }\n\n    private boolean hasFinalStageInfo(StageInfo stageInfo)\n    {\n        boolean isFinalStageInfo = isFinalStageInfo(stageInfo);\n        if (!isFinalStageInfo) {\n            try {\n                TimeUnit.MILLISECONDS.sleep(100);\n            }\n            catch (InterruptedException e) {\n                throw new RuntimeException(e);","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/operator/ExplainAnalyzeOperator.java#L148-L184","documentation":"ExplainAnalyzeOperator.getOutput renders the analyzed plan for the requested explain format (TEXT or JSON) of the output stage. If the ExplainType is anything else, the default branch throws GENERIC_INTERNAL_ERROR since ExplainAnalyze only supports those formats by design.","triggerScenarios":"An EXPLAIN ANALYZE statement specifies an explain format other than TEXT or JSON (e.g. EXPLAIN ANALYZE FORMAT GRAPHVIZ), causing the switch in getOutput to fall through to default.","commonSituations":"Users run EXPLAIN ANALYZE FORMAT GRAPHVIZ or FORMAT XML expecting parity with plain EXPLAIN, which supports more formats.","solutions":["Use EXPLAIN ANALYZE FORMAT TEXT or FORMAT JSON only","Run plain EXPLAIN (without ANALYZE) for formats like GRAPHVIZ","Upgrade Presto if a newer version adds support for the desired format"],"exampleFix":"-- before\nEXPLAIN ANALYZE FORMAT GRAPHVIZ SELECT 1;\n-- after\nEXPLAIN ANALYZE FORMAT JSON SELECT 1;","handlingStrategy":"validation","validationCode":"Set<String> supported = Set.of(\"TEXT\", \"JSON\");\nif (!supported.contains(explainFormat)) {\n    // use plain EXPLAIN instead of EXPLAIN ANALYZE\n    throw new IllegalArgumentException(\"EXPLAIN ANALYZE supports only TEXT/JSON: \" + explainFormat);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use FORMAT TEXT or FORMAT JSON only with EXPLAIN ANALYZE","Reserve GRAPHVIZ/other formats for plain EXPLAIN","Validate client tooling that auto-generates EXPLAIN ANALYZE statements"],"tags":["explain","query-analysis","unsupported-format"],"backgroundTag":"unsupported-explain-format","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"}