{"record":{"id":"55584afd57f15c7a","repo":"apache/shardingsphere","slug":"unsupported-simple-expression","errorCode":null,"errorMessage":"Unsupported Simple Expression","messagePattern":"Unsupported Simple Expression","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":1169,"sourceCode":"    }\n    \n    private ASTNode createProjectionForSimpleExpressionSegment(final ASTNode projection, final AliasSegment alias, final SelectProjectionExprClauseContext ctx) {\n        if (projection instanceof SubqueryExpressionSegment) {\n            SubqueryExpressionSegment subqueryExpressionSegment = (SubqueryExpressionSegment) projection;\n            String text = ctx.start.getInputStream().getText(new Interval(subqueryExpressionSegment.getStartIndex(), subqueryExpressionSegment.getStopIndex()));\n            SubqueryProjectionSegment result = new SubqueryProjectionSegment(((SubqueryExpressionSegment) projection).getSubquery(), text);\n            result.setAlias(alias);\n            return result;\n        }\n        if (projection instanceof LiteralExpressionSegment) {\n            LiteralExpressionSegment column = (LiteralExpressionSegment) projection;\n            ExpressionProjectionSegment result = null == alias\n                    ? new ExpressionProjectionSegment(column.getStartIndex(), column.getStopIndex(), column.getText(), column)\n                    : new ExpressionProjectionSegment(column.getStartIndex(), ctx.alias().stop.getStopIndex(), column.getText(), column);\n            result.setAlias(alias);\n            return result;\n        }\n        throw new UnsupportedOperationException(\"Unsupported Simple Expression\");\n    }\n    \n    private ASTNode createProjectionForExpressionSegment(final ASTNode projection, final AliasSegment alias) {\n        // FIXME :For DISTINCT()\n        if (projection instanceof ColumnSegment) {\n            return createColumnProjectionSegment((ColumnSegment) projection, alias);\n        }\n        if (projection instanceof BinaryOperationExpression) {\n            return createExpressionProjectionSegment((BinaryOperationExpression) projection, alias);\n        }\n        if (projection instanceof MultisetExpression) {\n            return createExpressionProjectionSegment((MultisetExpression) projection, alias);\n        }\n        if (projection instanceof DatetimeExpression) {\n            return createDatetimeProjectionSegment((DatetimeExpression) projection);\n        }\n        if (projection instanceof IntervalExpressionProjection) {\n            return createIntervalExpressionProjection((IntervalExpressionProjection) projection);","sourceCodeStart":1151,"sourceCodeEnd":1187,"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#L1151-L1187","documentation":"Thrown by OracleDMLStatementVisitor.createProjectionForSimpleExpressionSegment when a 'simple' projection is neither SubqueryExpressionSegment nor LiteralExpressionSegment. The UnsupportedOperationException('Unsupported Simple Expression') is a narrow coverage gap: only subqueries and literals are handled as simple expressions in this branch.","triggerScenarios":"A projection routed here (via the SimpleExpressionSegment branch in 613) whose concrete node is not a subquery or literal — e.g. a parameter marker or variable expression classified as 'simple' by an instanceof on a marker interface but lacking a dedicated branch here.","commonSituations":"Prepared statements with ? markers in unusual projection positions; bind-variable-heavy Oracle SQL; upgrades that reclassify segments under the SimpleExpressionSegment hierarchy.","solutions":["Replace the expression with a literal or move it into a subquery projection form","Check whether a newer ShardingSphere version adds the missing simple-expression branch","Reproduce with a minimal SELECT and file an upstream issue including the statement"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { parserEngine.parse(sql); } catch (UnsupportedOperationException e) { throw new StatementUnsupportedException(sql, e); }","preventionTips":["Use literals or subqueries in projections; avoid unusual parameter-marker placements","Verify prepared-statement projections parse before deploying"],"tags":["oracle","dml","simple-expression","projection","visitor"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}