{"record":{"id":"a3c615d2ed7f4848","repo":"alibaba/DataX","slug":"301","errorCode":"-301","errorMessage":"ADS LOAD DATA table is null.","messagePattern":"ADS LOAD DATA 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":216,"sourceCode":"            }\n        }\n\n    }\n\n    /**\n     * Submit LOAD DATA command.\n     * \n     * @param table The target ADS table\n     * @param partition The partition option in the form of \"(partition_name,...)\"\n     * @param sourcePath The source path\n     * @param overwrite\n     * @return\n     * @throws AdsException\n     */\n    public String loadData(String table, String partition, String sourcePath, boolean overwrite) throws AdsException {\n\n        if (table == null) {\n            throw new AdsException(AdsException.ADS_LOADDATA_TABLE_NULL, \"ADS LOAD DATA table is null.\", null);\n        }\n\n        if (sourcePath == null) {\n            throw new AdsException(AdsException.ADS_LOADDATA_SOURCEPATH_NULL, \"ADS LOAD DATA source path is null.\",\n                    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.\",","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/alibaba/DataX/blob/80ec23d5c5328eb90ca364d2749e92dfaf44541e/adswriter/src/main/java/com/alibaba/datax/plugin/writer/adswriter/load/AdsHelper.java#L198-L234","documentation":"First guard in AdsHelper.loadData(String table, ...): a null table name throws AdsException code -301 (ADS_LOADDATA_TABLE_NULL) before the LOAD DATA statement is composed. The submission path for bulk load requires the target ADS table explicitly.","triggerScenarios":"Calling loadData with table=null - in the DataX odps-to-ads flow, the job config's table key is missing or the writer passed null through.","commonSituations":"Job JSON omits the table key for an ocstoads/ads load job, or the table list is empty and code took the first element of an empty array.","solutions":["Supply the target ADS table name in the job's writer parameter (correct 'table' key).","If table comes from an array/list, verify it is non-empty before index access.","Programmatic callers: pass a literal non-null table argument to loadData."],"exampleFix":"// before\nhelper.loadData(null, partition, \"oss://bucket/path\", true);\n// after\nhelper.loadData(\"my_ads_table\", partition, \"oss://bucket/path\", true);","handlingStrategy":"validation","validationCode":"if (table == null) throw new IllegalArgumentException(\"loadData requires a target ADS table\");","typeGuard":"boolean hasTableName(String t) { return t != null && !t.trim().isEmpty(); }","tryCatchPattern":"try {\n    return helper.loadData(table, partition, sourcePath, overwrite);\n} catch (AdsException e) {\n    if (e.getCode() == AdsException.ADS_LOADDATA_TABLE_NULL) {\n        throw new IllegalStateException(\"load phase: target table not configured\", e);\n    }\n    throw e;\n}","preventionTips":["Guard list/array-derived table names against empty collections before index access.","Keep the table key present in every phase of the job config (insert and load).","Programmatic callers: assert non-null args at the top of wrapper methods."],"tags":["adswriter","load-data","config","validation"],"backgroundTag":null,"analyzedSha":"80ec23d5c5328eb90ca364d2749e92dfaf44541e","analyzedAt":"2026-08-14T15:33:51.187Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}