{"record":{"id":"b4e5402d4371fd04","repo":"apache/shardingsphere","slug":"30001-b4e540","errorCode":"30001","errorMessage":"Unsupported SQL operation: %s.","messagePattern":"Unsupported SQL operation: (.+?)\\.","errorType":"exception","errorClass":"UnsupportedSQLOperationException","httpStatus":null,"severity":"error","filePath":"proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLProxyBackendHandlerFactory.java","lineNumber":63,"sourceCode":"     * @param queryContext query context\n     * @param connectionSession connection session\n     * @return proxy backend handler\n     * @throws UnsupportedSQLOperationException unsupported SQL operation exception\n     */\n    public static ProxyBackendHandler newInstance(final DistSQLStatement sqlStatement, final QueryContext queryContext, final ConnectionSession connectionSession) {\n        ContextManager contextManager = ProxyContext.getInstance().getContextManager();\n        if (sqlStatement instanceof RQLStatement || sqlStatement instanceof RULStatement) {\n            return new DistSQLQueryProxyBackendHandler(sqlStatement, queryContext, connectionSession, contextManager);\n        }\n        if (sqlStatement instanceof RDLStatement) {\n            return new DistSQLUpdateProxyBackendHandler(sqlStatement, queryContext, connectionSession, contextManager);\n        }\n        if (sqlStatement instanceof RALStatement) {\n            return sqlStatement instanceof QueryableRALStatement\n                    ? new DistSQLQueryProxyBackendHandler(sqlStatement, queryContext, connectionSession, contextManager)\n                    : new DistSQLUpdateProxyBackendHandler(sqlStatement, queryContext, connectionSession, contextManager);\n        }\n        throw new UnsupportedSQLOperationException(sqlStatement.getClass().getName());\n    }\n}\n","sourceCodeStart":45,"sourceCodeEnd":66,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLProxyBackendHandlerFactory.java#L45-L66","documentation":"UnsupportedSQLOperationException (error code 30001) thrown by DistSQLProxyBackendHandlerFactory when a DistSQL statement is not an RQLStatement, RULStatement, RDLStatement, or RALStatement. The factory maps RQL/RUL and queryable RAL to DistSQLQueryProxyBackendHandler, RDL and non-queryable RAL to DistSQLUpdateProxyBackendHandler; anything else (a statement outside the DistSQL rule-*, resource-*, etc. families) is rejected.","triggerScenarios":"Executing a DistSQL statement whose parsed type does not extend any of the four DistSQL base interfaces — e.g. a custom or newly added DistSQL grammar whose statement class was not made to extend RDLStatement/RQLStatement/RULStatement/RALStatement, or a non-DistSQL statement misrouted into the DistSQL frontend handler.","commonSituations":"Custom DistSQL extension where the statement class forgot to extend a base DistSQL interface; parser/feature version mismatch after upgrading one module; sending native SQL (SHOW DATABASES) down a path that assumed DistSQL.","solutions":["Verify the statement class extends one of RQLStatement/RULStatement/RDLStatement/RALStatement (for RAL, also decide QueryableRALStatement vs not to pick query vs update handler)","Re-check the DistSQL syntax against the version's documented grammar; unsupported/misspelled statements may parse into an unexpected type","Upgrade shardingsphere modules together so new DistSQL types are recognized by the factory"],"exampleFix":"// before\nclass MyCustomStatement extends AbstractSQLStatement { }\n\n// after\nclass MyCustomStatement extends RDLStatement { }","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"private boolean isSupportedDistSQL(final SQLStatement stmt) {\n    return stmt instanceof RQLStatement || stmt instanceof RULStatement\n            || stmt instanceof RDLStatement || stmt instanceof RALStatement;\n}","tryCatchPattern":"try {\n    handler = DistSQLProxyBackendHandlerFactory.newInstance(sqlStatement, queryContext, connectionSession);\n} catch (final UnsupportedSQLOperationException ex) {\n    // not a DistSQL family statement: check grammar/keyword and correct the client statement\n}","preventionTips":["Make custom DistSQL statements extend one of the four base interfaces (RDL/RQL/RUL/RAL)","Validate DistSQL syntax against the version's grammar reference before shipping client tooling"],"tags":["distsql","proxy","unsupported-operation","factory","grammar"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}