{"record":{"id":"e90fedf57926fa58","repo":"apache/seatunnel","slug":"unsupported-handlesplitrequest-d","errorCode":null,"errorMessage":"Unsupported handleSplitRequest: %d","messagePattern":"Unsupported handleSplitRequest: (.+?)","errorType":"exception","errorClass":"ClickhouseConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/source/split/ClickhouseSourceSplitEnumerator.java","lineNumber":144,"sourceCode":"                assignSplit(Collections.singletonList(subtaskId));\n            } else {\n                LOG.warn(\n                        \"Reader {} is not registered. Pending splits {} are not assigned.\",\n                        subtaskId,\n                        splits);\n            }\n        }\n        LOG.info(\"Add back splits {} to JdbcSourceSplitEnumerator.\", splits.size());\n    }\n\n    @Override\n    public int currentUnassignedSplitSize() {\n        return this.pendingSplit.size();\n    }\n\n    @Override\n    public void handleSplitRequest(int subtaskId) {\n        throw new ClickhouseConnectorException(\n                CommonErrorCodeDeprecated.UNSUPPORTED_OPERATION,\n                String.format(\"Unsupported handleSplitRequest: %d\", subtaskId));\n    }\n\n    @Override\n    public void registerReader(int subtaskId) {\n        LOG.info(\"Register reader {} to ClickhouseSourceSplitEnumerator.\", subtaskId);\n        if (!pendingSplit.isEmpty()) {\n            synchronized (stateLock) {\n                assignSplit(Collections.singletonList(subtaskId));\n            }\n        }\n    }\n\n    @Override\n    public ClickhouseSourceState snapshotState(long checkpointId) throws Exception {\n        synchronized (stateLock) {\n            return new ClickhouseSourceState(shouldEnumerate, pendingSplit);","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/source/split/ClickhouseSourceSplitEnumerator.java#L126-L162","documentation":"ClickhouseSourceSplitEnumerator does not support on-demand split requests from readers: readers receive splits via assignment in handleSplitRequest's place, so any reader that calls handleSplitRequest(subtaskId) triggers this UNSUPPORTED_OPERATION exception. It is an internal-protocol guard, not a data error.","triggerScenarios":"A SourceReader registered via registerReader then issues a split request to the enumerator (e.g. reader requests more splits after finishing its batch), which this enumerator's implementation always rejects with String.format(\"Unsupported handleSplitRequest: %d\", subtaskId).","commonSituations":"Engine/source combination that uses the request-response split assignment protocol instead of the push model; running this connector on a translation layer (Flink/Spark) whose readers proactively request splits; custom reader code calling handleSplitRequest directly.","solutions":["Don't call handleSplitRequest from reader code; rely on the enumerator's push-based addSplitBack/assignSplit flow.","Ensure the source reader's handledSplitsWithSnapshotEnd/ noMoreElement logic signals completion instead of requesting new splits.","If running under Flink/Spark translation, verify the connector version matches the translation module version.","Report as a bug if stock reader code triggers it during a normal parallel read."],"exampleFix":"// before: reader requesting splits\ncontext.sendSplitRequest();\n// after: wait for enumerator-pushed assignment\n// (remove sendSplitRequest call; splits arrive automatically via addSplits)","handlingStrategy":"type-guard","validationCode":"// Only rely on push-based assignment; verify enumerator type before requesting\nif (!(splitEnumerator instanceof ClickhouseSourceSplitEnumerator)) {\n  context.sendSplitRequest(); // safe only for request-capable enumerators\n}","typeGuard":"boolean supportsSplitRequests(SourceSplitEnumerator<?, ?> e) {\n  return !(e instanceof ClickhouseSourceSplitEnumerator);\n}","tryCatchPattern":"try {\n  enumerator.handleSplitRequest(subtaskId);\n} catch (ClickhouseConnectorException e) {\n  if (e.getSeaTunnelErrorCode() == CommonErrorCodeDeprecated.UNSUPPORTED_OPERATION) {\n    // fall back to push-based assignment; don't retry the request\n  } else throw e;\n}","preventionTips":["Never call handleSplitRequest manually for this connector.","Match reader and enumerator implementations from the same SeaTunnel version.","Check translation-module (Flink/Spark) compatibility before upgrading.","Review stack trace to identify which reader code initiated the request."],"tags":["clickhouse","split-enumerator","unsupported-operation","protocol"],"backgroundTag":"unsupported-operation","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}