alibaba/DataX · error · AdsException
-301
-301
Error message
ADS LOAD DATA table is null.
What it means
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.
Source
Thrown at adswriter/src/main/java/com/alibaba/datax/plugin/writer/adswriter/load/AdsHelper.java:216
}
}
}
/**
* Submit LOAD DATA command.
*
* @param table The target ADS table
* @param partition The partition option in the form of "(partition_name,...)"
* @param sourcePath The source path
* @param overwrite
* @return
* @throws AdsException
*/
public String loadData(String table, String partition, String sourcePath, boolean overwrite) throws AdsException {
if (table == null) {
throw new AdsException(AdsException.ADS_LOADDATA_TABLE_NULL, "ADS LOAD DATA table is null.", null);
}
if (sourcePath == null) {
throw new AdsException(AdsException.ADS_LOADDATA_SOURCEPATH_NULL, "ADS LOAD DATA source path is null.",
null);
}
if (adsURL == null) {
throw new AdsException(AdsException.ADS_CONN_URL_NOT_SET, "ADS JDBC connection URL was not set.", null);
}
if (userName == null) {
throw new AdsException(AdsException.ADS_CONN_USERNAME_NOT_SET,
"ADS JDBC connection user name was not set.", null);
}
if (password == null) {
throw new AdsException(AdsException.ADS_CONN_PASSWORD_NOT_SET, "ADS JDBC connection password was not set.",View on GitHub (pinned to 80ec23d5c5)
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.
Example fix
// before
helper.loadData(null, partition, "oss://bucket/path", true);
// after
helper.loadData("my_ads_table", partition, "oss://bucket/path", true); Defensive patterns
Strategy: validation
Validate before calling
if (table == null) throw new IllegalArgumentException("loadData requires a target ADS table"); Type guard
boolean hasTableName(String t) { return t != null && !t.trim().isEmpty(); } Try / catch
try {
return helper.loadData(table, partition, sourcePath, overwrite);
} catch (AdsException e) {
if (e.getCode() == AdsException.ADS_LOADDATA_TABLE_NULL) {
throw new IllegalStateException("load phase: target table not configured", e);
}
throw e;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
AI-assisted analysis of alibaba/DataX@80ec23d5c5 (2026-08-14).
Data as JSON: /api/errors/a3c615d2ed7f4848.
Report an issue: GitHub.