{"record":{"id":"a4d89dc85598142d","repo":"apache/seatunnel","slug":"generate-splits-for-table-s-error","errorCode":null,"errorMessage":"Generate Splits for table %s error","messagePattern":"Generate Splits for table (.+?) error","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":130,"sourceCode":"                                    jdbc,\n                                    tableId,\n                                    i,\n                                    splitType,\n                                    chunk.getChunkStart(),\n                                    chunk.getChunkEnd());\n                    splits.add(split);\n                }\n            }\n\n            long end = System.currentTimeMillis();\n            log.info(\n                    \"Split table {} into {} chunks, time cost: {}ms.\",\n                    tableId,\n                    splits.size(),\n                    end - start);\n            return splits;\n        } catch (Exception e) {\n            throw new RuntimeException(\n                    String.format(\"Generate Splits for table %s error\", tableId), e);\n        }\n    }\n\n    private List<ChunkRange> splitTableIntoChunks(\n            JdbcConnection jdbc, TableId tableId, Column splitColumn) throws Exception {\n        final String splitColumnName = splitColumn.name();\n        final Object[] minMax = queryMinMax(jdbc, tableId, splitColumn);\n        final Object min = minMax[0];\n        final Object max = minMax[1];\n        if (min == null || max == null || min.equals(max)) {\n            // empty table, or only one row, return full table scan as a chunk\n            return Collections.singletonList(ChunkRange.all());\n        }\n\n        final int chunkSize = sourceConfig.getSplitSize();\n        final double distributionFactorUpper = sourceConfig.getDistributionFactorUpper();\n        final double distributionFactorLower = sourceConfig.getDistributionFactorLower();","sourceCodeStart":112,"sourceCodeEnd":148,"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#L112-L148","documentation":"A catch-all wrapper thrown at the end of generateSplits() when any unexpected exception occurs while splitting the table into snapshot chunks. It catches everything not already converted into the more specific errors (discovery, SQLException) and attaches the table id, with the real cause chained.","triggerScenarios":"Any Exception escaping the split procedure: query-building errors, unexpected driver behavior, failure computing split types (getSplitType), errors in queryEvenlySplitChunks / chunk boundary arithmetic, OOM-like driver errors inside splitting.","commonSituations":"Unusual column types chosen as the split key; driver version quirks; extremely skewed or huge tables; a bug/edge case in a specific dialect's splitter implementation.","solutions":["Inspect the chained cause to identify the specific underlying failure","Check the split column's data type; choose a numeric, date, or string PK/unique key with a supported type","Update the JDBC driver / SeaTunnel connector version if the cause points to a driver bug","Reduce chunk size or exclude the problematic table to isolate the issue"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Verify the split column type is supported before splitting:\nSELECT DATA_TYPE FROM information_schema.COLUMNS WHERE TABLE_SCHEMA='db' AND TABLE_NAME='t' AND COLUMN_NAME='id';","typeGuard":null,"tryCatchPattern":"try { return generateSplits(tableId); } catch (RuntimeException e) {\n    LOG.error(\"Split failed for {} cause={}\", tableId, e.getCause(), e);\n    throw e;\n}","preventionTips":["Use simple numeric/date PK columns as split keys","Keep JDBC driver and connector versions current","Test chunk splitting on production-like table shapes"],"tags":["cdc","jdbc","chunk-splitting"],"backgroundTag":"internal-invariant-violation","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"}