apache/seatunnel · error · RuntimeException
Generate Splits for table %s error
Error message
Generate Splits for table %s error
What it means
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.
Source
Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/enumerator/splitter/AbstractJdbcSourceChunkSplitter.java:130
jdbc,
tableId,
i,
splitType,
chunk.getChunkStart(),
chunk.getChunkEnd());
splits.add(split);
}
}
long end = System.currentTimeMillis();
log.info(
"Split table {} into {} chunks, time cost: {}ms.",
tableId,
splits.size(),
end - start);
return splits;
} catch (Exception e) {
throw new RuntimeException(
String.format("Generate Splits for table %s error", tableId), e);
}
}
private List<ChunkRange> splitTableIntoChunks(
JdbcConnection jdbc, TableId tableId, Column splitColumn) throws Exception {
final String splitColumnName = splitColumn.name();
final Object[] minMax = queryMinMax(jdbc, tableId, splitColumn);
final Object min = minMax[0];
final Object max = minMax[1];
if (min == null || max == null || min.equals(max)) {
// empty table, or only one row, return full table scan as a chunk
return Collections.singletonList(ChunkRange.all());
}
final int chunkSize = sourceConfig.getSplitSize();
final double distributionFactorUpper = sourceConfig.getDistributionFactorUpper();
final double distributionFactorLower = sourceConfig.getDistributionFactorLower();View on GitHub (pinned to cf67b549a7)
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
Defensive patterns
Strategy: try-catch
Validate before calling
// Verify the split column type is supported before splitting: SELECT DATA_TYPE FROM information_schema.COLUMNS WHERE TABLE_SCHEMA='db' AND TABLE_NAME='t' AND COLUMN_NAME='id';
Try / catch
try { return generateSplits(tableId); } catch (RuntimeException e) {
LOG.error("Split failed for {} cause={}", tableId, e.getCause(), e);
throw e;
} Prevention
- Use simple numeric/date PK columns as split keys
- Keep JDBC driver and connector versions current
- Test chunk splitting on production-like table shapes
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- Exactly once is enabled, but not found primary key or unique
- Failed to split chunks for table " + tableId
- Failed to build the split data read statement.
- Failed to discover captured tables for enumerator
- Failed to discover remaining tables to capture
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/a4d89dc85598142d.
Report an issue: GitHub.