{"record":{"id":"ac5951e52e25f152","repo":"alibaba/canal","slug":"simpleddlparser-process-query-failed-pls-submit-i","errorCode":null,"errorMessage":"SimpleDdlParser process query failed. pls submit issue with this queryString: {} , and DdlResult: {}","messagePattern":"SimpleDdlParser process query failed\\. pls submit issue with this queryString: (.+?) , and DdlResult: (.+?)","errorType":"exception","errorClass":"CanalParseException","httpStatus":null,"severity":"warning","filePath":"parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java","lineNumber":343,"sourceCode":"                    // 如果解析到了正确的表信息，则根据全名进行清除\n                    tableMetaCache.clearTableMeta(schemaName0, tableName0);\n                } else {\n                    // 如果无法解析正确的表信息，则根据schema进行清除\n                    tableMetaCache.clearTableMetaWithSchemaName(schemaName0);\n                }\n            }\n        }\n\n        // fixed issue https://github.com/alibaba/canal/issues/58\n        if (result.getType() == EventType.ALTER || result.getType() == EventType.ERASE\n            || result.getType() == EventType.CREATE || result.getType() == EventType.TRUNCATE\n            || result.getType() == EventType.RENAME || result.getType() == EventType.CINDEX\n            || result.getType() == EventType.DINDEX) { // 针对DDL类型\n\n            if (!filterQueryDdl && (StringUtils.isEmpty(tableName)\n                || (result.getType() == EventType.RENAME && StringUtils.isEmpty(result.getOriTableName())))) {\n                // 如果解析不出tableName,记录一下日志，方便bugfix，目前直接抛出异常，中断解析\n                throw new CanalParseException(\"SimpleDdlParser process query failed. pls submit issue with this queryString: \"\n                                              + queryString + \" , and DdlResult: \" + result.toString());\n                // return null;\n            } else {\n                // check name filter\n                String name = schemaName + \".\" + tableName;\n                if (nameFilter != null && !nameFilter.filter(name)) {\n                    if (result.getType() == EventType.RENAME) {\n                        // rename校验只要源和目标满足一个就进行操作\n                        if (nameFilter != null\n                            && !nameFilter.filter(result.getOriSchemaName() + \".\" + result.getOriTableName())) {\n                            return true;\n                        }\n                    } else {\n                        // 其他情况返回null\n                        return true;\n                    }\n                }\n","sourceCodeStart":325,"sourceCodeEnd":361,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java#L325-L361","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before\ncanal.instance.filter.query.ddl=false\n\n# after — skip DDL events to avoid parser aborts\ncanal.instance.filter.query.ddl=true","handlingStrategy":"fallback","validationCode":"// Pre-check: if filterQueryDdl is false, validate the DDL parser can handle your schema's DDL\n// Enable filterQueryDdl=true if you don't need DDL events","typeGuard":null,"tryCatchPattern":"try {\n    boolean filtered = processFilter(queryString, result);\n} catch (CanalParseException e) {\n    if (e.getMessage().contains(\"SimpleDdlParser process query failed\")) {\n        // Log and skip — the DDL syntax is unsupported but shouldn't crash the pipeline\n        logger.warn(\"Unsupported DDL syntax, skipping: {}\", queryString, e);\n        return true; // filter out\n    }\n    throw e;\n}","preventionTips":["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."],"tags":["ddl","parser","simpleddlparser","ddl-parsing"],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}