{"record":{"id":"fdaf2467780f2a79","repo":"apache/shardingsphere","slug":"unhandled-case","errorCode":null,"errorMessage":"Unhandled case","messagePattern":"Unhandled case","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"parser/sql/engine/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/engine/oracle/visitor/statement/type/OracleDMLStatementVisitor.java","lineNumber":1130,"sourceCode":"    }\n    \n    private ASTNode createProjection(final SelectProjectionExprClauseContext ctx) {\n        AliasSegment alias = null == ctx.alias() ? null : (AliasSegment) visit(ctx.alias());\n        ASTNode projection = visit(ctx.expr());\n        if (projection instanceof AliasAvailable) {\n            ((AliasAvailable) projection).setAlias(alias);\n            return projection;\n        }\n        if (projection instanceof ComplexExpressionSegment) {\n            return createProjectionForComplexExpressionSegment(projection, alias);\n        }\n        if (projection instanceof SimpleExpressionSegment) {\n            return createProjectionForSimpleExpressionSegment(projection, alias, ctx);\n        }\n        if (projection instanceof ExpressionSegment) {\n            return createProjectionForExpressionSegment(projection, alias);\n        }\n        throw new UnsupportedOperationException(\"Unhandled case\");\n    }\n    \n    private ASTNode createProjectionForComplexExpressionSegment(final ASTNode projection, final AliasSegment alias) {\n        if (projection instanceof FunctionSegment) {\n            FunctionSegment segment = (FunctionSegment) projection;\n            ExpressionProjectionSegment result = new ExpressionProjectionSegment(segment.getStartIndex(), segment.getStopIndex(), segment.getText(), segment);\n            result.setAlias(alias);\n            return result;\n        }\n        if (projection instanceof CommonExpressionSegment) {\n            CommonExpressionSegment segment = (CommonExpressionSegment) projection;\n            ExpressionProjectionSegment result = new ExpressionProjectionSegment(segment.getStartIndex(), segment.getStopIndex(), segment.getText(), segment);\n            result.setAlias(alias);\n            return result;\n        }\n        if (projection instanceof XmlQueryAndExistsFunctionSegment || projection instanceof XmlPiFunctionSegment || projection instanceof XmlSerializeFunctionSegment\n                || projection instanceof XmlElementFunctionSegment) {\n            return createExpressionProjectionSegment((ExpressionSegment) projection, alias);","sourceCodeStart":1112,"sourceCodeEnd":1148,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/parser/sql/engine/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/engine/oracle/visitor/statement/type/OracleDMLStatementVisitor.java#L1112-L1148","documentation":"Thrown by OracleDMLStatementVisitor when a select projection with an alias cannot be classified. After the alias-available, ComplexExpressionSegment, SimpleExpressionSegment, and generic ExpressionSegment branches fail, the method throws UnsupportedOperationException('Unhandled case'). Like 612-616 this is a visitor coverage gap in Oracle projection mapping, not invalid SQL syntax.","triggerScenarios":"An Oracle SELECT projection whose visited node type is not AliasAvailable and implements none of the three expression interfaces — for example a segment type introduced by a grammar change or a rarely used expression form (certain XML/collection/row expressions fall through if their earlier-specific branches do not match).","commonSituations":"Complex analytic queries with unusual projections on Oracle; mixing new SQL features after an upgrade; custom parser extensions registering segment types without extending this visitor.","solutions":["Rewrite the projection into a simpler expression or plain column","Test with a newer ShardingSphere release where additional segment types are handled","Isolate the failing projection by reducing the select list item by item","File an issue with the exact expression so the branch is added upstream"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { parserEngine.parse(sql); } catch (UnsupportedOperationException e) { logAndSimplifyProjection(sql, e); }","preventionTips":["Reduce select lists to columns, literals, and standard arithmetic when routing through ShardingSphere","Track upstream visitor coverage in release notes before adopting exotic Oracle expressions"],"tags":["oracle","dml","projection","visitor","select"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}