alibaba/canal · warning · CanalParseException
SimpleDdlParser process query failed. pls submit issue with
Error message
SimpleDdlParser process query failed. pls submit issue with this queryString: {} , and DdlResult: {} What it means
Thrown from processFilter() when a DDL event (ALTER, ERASE/DROP, CREATE, TRUNCATE, RENAME, CINDEX, DINDEX) is parsed by SimpleDdlParser but the resulting tableName is empty (or for RENAME, the oriTableName is empty). Canal cannot determine which table the DDL affects, so it aborts DDL parsing with this exception, unless filterQueryDdl is enabled.
Source
Thrown at parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java:343
// 如果解析到了正确的表信息,则根据全名进行清除
tableMetaCache.clearTableMeta(schemaName0, tableName0);
} else {
// 如果无法解析正确的表信息,则根据schema进行清除
tableMetaCache.clearTableMetaWithSchemaName(schemaName0);
}
}
}
// fixed issue https://github.com/alibaba/canal/issues/58
if (result.getType() == EventType.ALTER || result.getType() == EventType.ERASE
|| result.getType() == EventType.CREATE || result.getType() == EventType.TRUNCATE
|| result.getType() == EventType.RENAME || result.getType() == EventType.CINDEX
|| result.getType() == EventType.DINDEX) { // 针对DDL类型
if (!filterQueryDdl && (StringUtils.isEmpty(tableName)
|| (result.getType() == EventType.RENAME && StringUtils.isEmpty(result.getOriTableName())))) {
// 如果解析不出tableName,记录一下日志,方便bugfix,目前直接抛出异常,中断解析
throw new CanalParseException("SimpleDdlParser process query failed. pls submit issue with this queryString: "
+ queryString + " , and DdlResult: " + result.toString());
// return null;
} else {
// check name filter
String name = schemaName + "." + tableName;
if (nameFilter != null && !nameFilter.filter(name)) {
if (result.getType() == EventType.RENAME) {
// rename校验只要源和目标满足一个就进行操作
if (nameFilter != null
&& !nameFilter.filter(result.getOriSchemaName() + "." + result.getOriTableName())) {
return true;
}
} else {
// 其他情况返回null
return true;
}
}
View on GitHub (pinned to 87be50e876)
Solutions
- Set canal.instance.filter.query.ddl = true in instance.properties to skip DDL events entirely if they are not needed.
- Upgrade Canal to a newer version that has an updated SimpleDdlParser with broader syntax coverage.
- Report the issue to the Canal project with the queryString from the exception message (the message explicitly asks for this).
- If the DDL is from a known unsupported tool, pre-process or filter those queries at the MySQL level.
Example fix
# before canal.instance.filter.query.ddl=false # after — skip DDL events to avoid parser aborts canal.instance.filter.query.ddl=true
Defensive patterns
Strategy: fallback
Validate before calling
// Pre-check: if filterQueryDdl is false, validate the DDL parser can handle your schema's DDL // Enable filterQueryDdl=true if you don't need DDL events
Try / catch
try {
boolean filtered = processFilter(queryString, result);
} catch (CanalParseException e) {
if (e.getMessage().contains("SimpleDdlParser process query failed")) {
// Log and skip — the DDL syntax is unsupported but shouldn't crash the pipeline
logger.warn("Unsupported DDL syntax, skipping: {}", queryString, e);
return true; // filter out
}
throw e;
} Prevention
- Set canal.instance.filter.query.ddl=true if DDL events are not needed by downstream consumers.
- Upgrade Canal when migrating to a newer MySQL version that introduces new DDL syntax.
- Collect unsupported DDL queries in a log for batch reporting to the Canal project.
When it happens
Trigger: A DDL query string that the SimpleDdlParser fails to extract a table name from. This happens with unusual or unsupported DDL syntax: complex CREATE TABLE with nested definitions, DDL with comments/stored procedures, database-level DDL (CREATE DATABASE), or syntax new to a MySQL version that the parser hasn't been updated for.
Common situations: A migration tool generates DDL with syntax the parser doesn't handle. A newer MySQL version introduces DDL syntax (e.g. CREATE TABLE ... PARTITION, invisible columns, vector types) not yet supported by the bundled parser. The DDL contains multi-statements or semicolons that confuse the parser. A stored procedure or function DDL is encountered.
Related errors
- unknow column : + name
- column size is not match for table:{},{} vs {}
- MySQL8.0 unmatch column metadata & pls submit issue , table
- apply to memory is failed
- apply history to db failed caused by : {errorMessage}
AI-assisted analysis of alibaba/canal@87be50e876 (2026-08-14).
Data as JSON: /api/errors/ac5951e52e25f152.
Report an issue: GitHub.