{"record":{"id":"6e07a1154d920420","repo":"prestodb/presto","slug":"unsupported-set-operation","errorCode":null,"errorMessage":"Unsupported set operation: ","messagePattern":"Unsupported set operation: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-parser/src/main/java/com/facebook/presto/sql/parser/AstBuilder.java","lineNumber":1277,"sourceCode":"        if (context.setQuantifier() != null) {\n            if (context.setQuantifier().DISTINCT() != null) {\n                distinct = Optional.of(true);\n            }\n            else if (context.setQuantifier().ALL() != null) {\n                distinct = Optional.of(false);\n            }\n        }\n\n        switch (context.operator.getType()) {\n            case SqlBaseLexer.UNION:\n                return new Union(getLocation(context.UNION()), ImmutableList.of(left, right), distinct);\n            case SqlBaseLexer.INTERSECT:\n                return new Intersect(getLocation(context.INTERSECT()), ImmutableList.of(left, right), distinct);\n            case SqlBaseLexer.EXCEPT:\n                return new Except(getLocation(context.EXCEPT()), left, right, distinct);\n        }\n\n        throw new IllegalArgumentException(\"Unsupported set operation: \" + context.operator.getText());\n    }\n\n    @Override\n    public Node visitSelectAll(SqlBaseParser.SelectAllContext context)\n    {\n        if (context.qualifiedName() != null) {\n            return new AllColumns(getLocation(context), getQualifiedName(context.qualifiedName()));\n        }\n\n        return new AllColumns(getLocation(context));\n    }\n\n    @Override\n    public Node visitSelectSingle(SqlBaseParser.SelectSingleContext context)\n    {\n        return new SingleColumn(\n                getLocation(context),\n                (Expression) visit(context.expression()),","sourceCodeStart":1259,"sourceCodeEnd":1295,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-parser/src/main/java/com/facebook/presto/sql/parser/AstBuilder.java#L1259-L1295","documentation":"Default case of the set-operation switch in AstBuilder: the parser produced a set operation token (UNION/INTERSECT/EXCEPT expected) that the builder does not recognize. Fires on grammar/AST drift or malformed query trees rather than ordinary user input; the message echoes the offending token text.","triggerScenarios":"Thrown at presto-parser/src/main/java/com/facebook/presto/sql/parser/AstBuilder.java:1277 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use standard UNION, INTERSECT, or EXCEPT between queries","Check the Presto/grammar version consistency if this appears with valid SQL"],"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"}