{"record":{"id":"adeda1f85ccfabd2","repo":"alibaba/canal","slug":"dbmapping-targettable-adeda1","errorCode":null,"errorMessage":"dbMapping.targetTable","messagePattern":"dbMapping\\.targetTable","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":85,"sourceCode":"    }\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;                 // 字段默认大写加双引号\n\n        private String targetDb;                            // 目标库名\n        private String targetTable;                         // 目标表名","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/client-adapter/phoenix/src/main/java/com/alibaba/otter/canal/client/adapter/phoenix/config/MappingConfig.java#L67-L103","documentation":"Thrown by phoenix MappingConfig.validate() when dbMapping.targetTable is null or empty. targetTable is the destination Phoenix table name where data is written; it is always required for phoenix mappings.","triggerScenarios":"A phoenix mapping yml's dbMapping block omits or blanks 'targetTable:'.","commonSituations":"Template missing 'targetTable:', or a value like 'targetTable: \"\"'.","solutions":["Add a non-empty 'targetTable:' under dbMapping (e.g. 'mytest.user').","Verify indentation under dbMapping."],"exampleFix":"# before\ndbMapping:\n  database: mytest\n  table: user\n# after\ndbMapping:\n  database: mytest\n  table: user\n  targetTable: mytest.user","handlingStrategy":"validation","validationCode":"DbMapping m = config.getDbMapping();\nif (m == null || m.getTargetTable() == null || m.getTargetTable().isEmpty()) {\n    throw new IllegalArgumentException(\"phoenix yml missing dbMapping.targetTable for \" + fileName);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set targetTable in phoenix yml (e.g. schema.table).","Lint phoenix yml files in CI."],"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"}