{"record":{"id":"07aa58293c366736","repo":"alibaba/canal","slug":"dbmapping-table-07aa58","errorCode":null,"errorMessage":"dbMapping.table","messagePattern":"dbMapping\\.table","errorType":"validation","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"client-adapter/phoenix/src/main/java/com/alibaba/otter/canal/client/adapter/phoenix/config/MappingConfig.java","lineNumber":82,"sourceCode":"\n    public void setDestination(String destination) {\n        this.destination = destination;\n    }\n\n    public boolean isDebug() {\n        return debug;\n    }\n\n    public void setDebug(boolean debug) {\n        this.debug = debug;\n    }\n\n    public void validate() {\n        if (dbMapping.database == null || dbMapping.database.isEmpty()) {\n            throw new NullPointerException(\"dbMapping.database\");\n        }\n        if ((dbMapping.table == null || dbMapping.table.isEmpty())) {\n            throw new NullPointerException(\"dbMapping.table\");\n        }\n        if ((dbMapping.targetTable == null || dbMapping.targetTable.isEmpty())) {\n            throw new NullPointerException(\"dbMapping.targetTable\");\n        }\n    }\n\n    public static class DbMapping {\n\n        private String database;                            // 数据库名或schema名\n        private String table;                               // 表名\n        private Map<String, String> targetPk = new LinkedHashMap<>(); // 目标表主键字段\n        private boolean mapAll = true;                      // 映射所有字段\n\n        private boolean alter = true;                       // 是否允许修改表\n        private boolean drop = false;                       // 是否允许删除字段\n        private boolean limit = false;                      // 是否限制字段长度\n        private boolean skipMissing = false;                // 是否跳过丢失的字段\n        private boolean escapeUpper = true;                 // 字段默认大写加双引号","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/client-adapter/phoenix/src/main/java/com/alibaba/otter/canal/client/adapter/phoenix/config/MappingConfig.java#L64-L100","documentation":"Thrown by phoenix MappingConfig.validate() when dbMapping.table is null or empty. table is the source table name; without it the adapter cannot match events. Unlike the rdb adapter, phoenix has no mirrorDb exemption, so table is always required.","triggerScenarios":"A phoenix mapping yml's dbMapping block omits or blanks 'table:'.","commonSituations":"Template copy with 'table:' removed or mis-indented.","solutions":["Add a non-empty 'table:' under dbMapping in the failing phoenix yml.","Ensure 'table' is indented as a child of dbMapping."],"exampleFix":"# before\ndbMapping:\n  database: mytest\n# after\ndbMapping:\n  database: mytest\n  table: user","handlingStrategy":"validation","validationCode":"DbMapping m = config.getDbMapping();\nif (m == null || m.getTable() == null || m.getTable().isEmpty()) {\n    throw new IllegalArgumentException(\"phoenix yml missing dbMapping.table for \" + fileName);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Phoenix always requires table (no mirrorDb mode); ensure every phoenix yml sets it.","Use the bundled template as a base."],"tags":["phoenix","config-validation","canal","yaml"],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}