apache/seatunnel · error · IllegalArgumentException
ddl can not be null or empty string!
Error message
ddl can not be null or empty string!
What it means
executeThenReturnResponse refuses to send an HTTP request to the Doris FE when the generated DDL string is null or empty. This is an early invariant check: building an empty ALTER statement would produce a confusing HTTP error from FE, so the manager fails fast with IllegalArgumentException.
Solutions
- Log/inspect the schema-change event that produced the empty DDL and ensure it has the required column data
- Skip schema changes whose generated DDL is empty instead of executing
- Upgrade the connector if the event is a legitimate change that should produce non-empty DDL
Example fix
// before
String ddl = buildDdl(event);
schemaChangeManager.executeThenReturnResponse(ddl, db);
// after
String ddl = buildDdl(event);
if (ddl != null && !ddl.isEmpty()) {
schemaChangeManager.executeThenReturnResponse(ddl, db);
} Defensive patterns
Strategy: validation
Validate before calling
if (ddl == null || ddl.trim().isEmpty()) throw new IllegalArgumentException("generated DDL is empty"); Try / catch
try {
return manager.executeThenReturnResponse(ddl, db);
} catch (IllegalArgumentException e) {
log.warn("Skipping schema change: {}", e.getMessage());
return null;
} Prevention
- Validate schema events contain column data before generating DDL
- Log the event before building DDL to catch empty-column cases early
When it happens
Trigger: applySchemaChange generates a DDL string that ends up empty — e.g. an AlterColumnEvent with no columns to change, a column-name extraction bug, or a caller passing null ddl directly.
Common situations: Upstream schema event with empty field list; bug in buildColumns handling of type mapping that yields an empty ALTER clause; programmatic use of SchemaChangeManager with unvalidated input.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- Failed to alter table add column, SQL:
- Failed to alter table change column, SQL:
- Failed to alter table drop column, SQL:
- Failed to alter table modify column, SQL:
- is less than , set to default value .
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/b65ef018d3f08bba.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/schema/SchemaChangeManager.java:293
String.format(
"ALTER TABLE %s DROP COLUMN %s",
tablePath.getFullName(), quoteIdentifier(event.getColumn()));
if (!execute(dropColumnSQL, tablePath.getDatabaseName())) {
log.warn("Failed to alter table drop column, SQL:" + dropColumnSQL);
}
}
/** execute sql in doris. */
public boolean execute(String ddl, String database)
throws IOException, IllegalArgumentException {
String responseEntity = executeThenReturnResponse(ddl, database);
return handleSchemaChange(responseEntity);
}
private String executeThenReturnResponse(String ddl, String database)
throws IOException, IllegalArgumentException {
if (StringUtils.isEmpty(ddl)) {
throw new IllegalArgumentException("ddl can not be null or empty string!");
}
log.info("Execute SQL: {}", ddl);
HttpPost httpPost = buildHttpPost(ddl, database);
return handleResponse(httpPost);
}
private boolean handleSchemaChange(String responseEntity) throws JsonProcessingException {
Map<String, Object> responseMap = objectMapper.readValue(responseEntity, Map.class);
String code = responseMap.getOrDefault("code", "-1").toString();
if (code.equals("0")) {
return true;
} else {
return false;
}
}
/**
* Check if the column exists in the tableView on GitHub (pinned to cf67b549a7)