{"record":{"id":"c076b64e9462c8c4","repo":"prestodb/presto","slug":"view-parse-error-c076b6","errorCode":"VIEW_PARSE_ERROR","errorMessage":"Failed parsing stored view '%s': %s","messagePattern":"Failed parsing stored view '(.+?)': (.+?)","errorType":"error_code","errorClass":"SemanticException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/sql/rewrite/ShowQueriesRewrite.java","lineNumber":888,"sourceCode":"                            aliasedName(\"value\", \"Value\"),\n                            aliasedName(\"default\", \"Default\"),\n                            aliasedName(\"type\", \"Type\"),\n                            aliasedName(\"description\", \"Description\")),\n                    aliased(\n                            new Values(rows.build()),\n                            \"session\",\n                            ImmutableList.of(\"name\", \"value\", \"default\", \"type\", \"description\", \"include\")),\n                    predicate);\n        }\n\n        private Query parseView(String view, QualifiedObjectName name, Node node)\n        {\n            try {\n                Statement statement = sqlParser.createStatement(view, createParsingOptions(session, warningCollector));\n                return (Query) statement;\n            }\n            catch (ParsingException e) {\n                throw new SemanticException(VIEW_PARSE_ERROR, node, \"Failed parsing stored view '%s': %s\", name, e.getMessage());\n            }\n        }\n\n        private static Relation from(String catalog, SchemaTableName table)\n        {\n            return table(QualifiedName.of(catalog, table.getSchemaName(), table.getTableName()));\n        }\n\n        private static Optional<OrderBy> orderBy(List<SortItem> sortItems)\n        {\n            requireNonNull(sortItems, \"sortItems is null\");\n            if (sortItems.isEmpty()) {\n                return Optional.empty();\n            }\n            return Optional.of(new OrderBy(sortItems));\n        }\n\n        @Override","sourceCodeStart":870,"sourceCodeEnd":906,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/sql/rewrite/ShowQueriesRewrite.java#L870-L906","documentation":"Show-queries rewrite error: the stored view definition text for the named relation could not be re-parsed by the SQL parser (either the stored text is corrupted or was written by an incompatible older syntax). The %s pair gives the view name and the underlying parser error message.","triggerScenarios":"Thrown at presto-main-base/src/main/java/com/facebook/presto/sql/rewrite/ShowQueriesRewrite.java:888 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-create the view with current syntax (CREATE OR REPLACE VIEW)","Inspect the stored definition in the connector metadata and fix invalid SQL","Upgrade/migrate views created by an older Presto version"],"exampleFix":null,"handlingStrategy":"try-catch","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"}