alibaba/DataX · error · AdsException
-302
-302
Error message
ADS LOAD DATA source path is null.
What it means
Second guard in loadData: a null sourcePath throws AdsException code -302 (ADS_LOADDATA_SOURCEPATH_NULL). sourcePath is the ODPS/OSS location LOAD DATA reads from; without it the statement 'LOAD DATA FROM <path>' cannot be built.
Source
Thrown at adswriter/src/main/java/com/alibaba/datax/plugin/writer/adswriter/load/AdsHelper.java:220
/**
* 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.",
null);
}
if (schema == null) {View on GitHub (pinned to 80ec23d5c5)
Solutions
- Check the preceding staging/export step actually produced data and returned a path.
- Verify the config keys for the ODPS/OSS staging location (bucket, directory) are set.
- Add a null check on the path variable right after the export step and fail with a clearer message there.
- Pass the path including quotes only if it already has them; the method handles both, but it must not be null.
Example fix
// before
String path = odpsExport.getResultPath(); // null on failure
helper.loadData(table, partition, path, true);
// after
String path = odpsExport.getResultPath();
if (path == null) throw new IllegalStateException("odps export produced no path");
helper.loadData(table, partition, path, true); Defensive patterns
Strategy: validation
Validate before calling
if (sourcePath == null || sourcePath.trim().isEmpty()) {
throw new IllegalStateException("staging export produced no path; aborting LOAD DATA");
} Type guard
boolean isUsableSourcePath(String p) { return p != null && !p.trim().isEmpty(); } Try / catch
try {
return helper.loadData(table, partition, sourcePath, overwrite);
} catch (AdsException e) {
if (e.getCode() == AdsException.ADS_LOADDATA_SOURCEPATH_NULL) {
throw new IllegalStateException("upstream staging step failed to produce a path", e);
}
throw e;
} Prevention
- Treat a null/empty staging path from the ODPS export step as a hard failure of that step, not a load-phase problem.
- Log the staging path right after the export step so failures are diagnosable.
- Add existence checks on the staging directory before submitting LOAD DATA.
When it happens
Trigger: loadData invoked with sourcePath=null - e.g. the temp ODPS/OSS output path was never computed because an earlier export step failed silently or returned null.
Common situations: The odps writer step that stages data failed or was skipped; a path-building helper returned null on an edge case (empty partition); config for the staging directory is missing.
Related errors
AI-assisted analysis of alibaba/DataX@80ec23d5c5 (2026-08-14).
Data as JSON: /api/errors/afd999149cde02c1.
Report an issue: GitHub.