{"record":{"id":"772c7532d17eee0d","repo":"alibaba/DataX","slug":"405","errorCode":"-405","errorMessage":"Table is null.","messagePattern":"Table is null\\.","errorType":"error_code","errorClass":"AdsException","httpStatus":null,"severity":"error","filePath":"adswriter/src/main/java/com/alibaba/datax/plugin/writer/adswriter/load/AdsHelper.java","lineNumber":89,"sourceCode":"    public String getSchema() {\n        return schema;\n    }\n\n    public void setSchema(String schema) {\n        this.schema = schema;\n    }\n\n    /**\n     * Obtain the table meta information.\n     * \n     * @param table The table\n     * @return The table meta information\n     * @throws com.alibaba.datax.plugin.writer.adswriter.AdsException\n     */\n    public TableInfo getTableInfo(String table) throws AdsException {\n\n        if (table == null) {\n            throw new AdsException(AdsException.ADS_TABLEMETA_TABLE_NULL, \"Table is null.\", null);\n        }\n\n        if (adsURL == null) {\n            throw new AdsException(AdsException.ADS_CONN_URL_NOT_SET, \"ADS JDBC connection URL was not set.\", null);\n        }\n\n        if (userName == null) {\n            throw new AdsException(AdsException.ADS_CONN_USERNAME_NOT_SET,\n                    \"ADS JDBC connection user name was not set.\", null);\n        }\n\n        if (password == null) {\n            throw new AdsException(AdsException.ADS_CONN_PASSWORD_NOT_SET, \"ADS JDBC connection password was not set.\",\n                    null);\n        }\n\n        if (schema == null) {\n            throw new AdsException(AdsException.ADS_CONN_SCHEMA_NOT_SET, \"ADS JDBC connection schema was not set.\",","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/alibaba/DataX/blob/80ec23d5c5328eb90ca364d2749e92dfaf44541e/adswriter/src/main/java/com/alibaba/datax/plugin/writer/adswriter/load/AdsHelper.java#L71-L107","documentation":"AdsHelper.getTableInfo(String table) is the first of five guard clauses: it requires a non-null table name before it will query ADS metadata, throwing AdsException with code -405 (ADS_TABLEMETA_TABLE_NULL) otherwise. It means the caller never supplied the table to inspect.","triggerScenarios":"Calling getTableInfo(null) - in DataX this happens when the adswriter job config's 'table' key is missing so the writer passes a null table string into AdsHelper.","commonSituations":"Job JSON omits the table field, or names it 'tableName'/'tablename' so Key.TABLE reads null; also custom code constructing AdsHelper directly and forgetting setTable.","solutions":["Add the correct 'table' key (with the ADS table name string) to the writer parameter block of the job JSON.","Verify the exact key spelling the plugin version expects (table, not tableName).","If calling AdsHelper directly, pass a non-null table argument or set it before getTableInfo."],"exampleFix":"// before\n{\"name\":\"adswriter\",\"parameter\":{\"url\":\"...\"}}\n// after\n{\"name\":\"adswriter\",\"parameter\":{\"url\":\"...\",\"table\":\"my_ads_table\"}}","handlingStrategy":"validation","validationCode":"if (helper == null || !helper.isTableSet() /* or */ config.getString(\"table\") == null) {\n    throw new IllegalStateException(\"adswriter 'table' key is required\");\n}","typeGuard":"boolean hasTable(String table) { return table != null && !table.trim().isEmpty(); }","tryCatchPattern":"try {\n    return helper.getTableInfo(table);\n} catch (AdsException e) {\n    if (e.getCode() == AdsException.ADS_TABLEMETA_TABLE_NULL) {\n        throw new IllegalStateException(\"job config: 'table' missing for adswriter\", e);\n    }\n    throw e;\n}","preventionTips":["Always include the table key in adswriter job configs; lint configs in CI.","Use the exact key names documented for your plugin version (table, not tableName).","Fail fast in your own code when extracting required fields from Configuration."],"tags":["adswriter","config","validation","metadata"],"backgroundTag":null,"analyzedSha":"80ec23d5c5328eb90ca364d2749e92dfaf44541e","analyzedAt":"2026-08-14T15:33:51.187Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}