{"record":{"id":"db1279dc41918275","repo":"apache/seatunnel","slug":"failed-to-split-chunks-for-table-tableid","errorCode":null,"errorMessage":"Failed to split chunks for table \" + tableId","messagePattern":"Failed to split chunks for table \" \\+ tableId","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/enumerator/splitter/AbstractJdbcSourceChunkSplitter.java","lineNumber":103,"sourceCode":"            if (splitColumn == null) {\n                if (sourceConfig.isExactlyOnce()) {\n                    throw new UnsupportedOperationException(\n                            String.format(\n                                    \"Exactly once is enabled, but not found primary key or unique key for table %s\",\n                                    tableId));\n                }\n                SnapshotSplit singleSplit = createSnapshotSplit(jdbc, tableId, 0, null, null, null);\n                splits.add(singleSplit);\n                log.warn(\n                        \"No evenly split column found for table {}, use single split {}\",\n                        tableId,\n                        singleSplit);\n            } else {\n                final List<ChunkRange> chunks;\n                try {\n                    chunks = splitTableIntoChunks(jdbc, tableId, splitColumn);\n                } catch (SQLException e) {\n                    throw new RuntimeException(\"Failed to split chunks for table \" + tableId, e);\n                }\n\n                // convert chunks into splits\n                SeaTunnelRowType splitType = getSplitType(splitColumn);\n                for (int i = 0; i < chunks.size(); i++) {\n                    ChunkRange chunk = chunks.get(i);\n                    SnapshotSplit split =\n                            createSnapshotSplit(\n                                    jdbc,\n                                    tableId,\n                                    i,\n                                    splitType,\n                                    chunk.getChunkStart(),\n                                    chunk.getChunkEnd());\n                    splits.add(split);\n                }\n            }\n","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/enumerator/splitter/AbstractJdbcSourceChunkSplitter.java#L85-L121","documentation":"Wraps a SQLException raised while splitTableIntoChunks() executes the queries that probe the split column's min/max values and chunk boundaries. The connector rethrows it as a RuntimeException naming the table. It means the chunking SQL itself failed, not the overall table discovery.","triggerScenarios":"generateSplits() -> splitTableIntoChunks(jdbc, tableId, splitColumn) throws SQLException (query timeout, permission denied on the table, numeric/date overflow in boundary computation, connection dropped mid-query).","commonSituations":"CDC user lacks SELECT on the table; very large tables causing slow boundary queries that hit network/timeout limits; connection killed by the DB (wait_timeout); datatype-specific failures casting min/max values.","solutions":["Read the chained SQLException for the exact SQL error","Verify the CDC user has SELECT privilege on the target table (chunking samples min/max)","Check DB connectivity/timeouts; raise wait_timeout or connector connection settings for long-running queries","Retry the job if the failure was a transient connection drop"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Pre-check SELECT privilege and run a boundary probe:\nSELECT MIN(pk), MAX(pk) FROM db.t; -- run with the CDC user before the job","typeGuard":null,"tryCatchPattern":"try { chunks = splitTableIntoChunks(jdbc, tableId, splitColumn); }\ncatch (SQLException e) {\n  if (isTransient(e)) { retryWithBackoff(3); } else { throw new RuntimeException(\"Failed to split chunks for \" + tableId, e); }\n}","preventionTips":["Grant the CDC user SELECT on all captured tables","Tune connection/timeout settings for large tables","Monitor DB connection health (wait_timeout)"],"tags":["jdbc","cdc","sql","chunk-splitting"],"backgroundTag":"sql-query-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}