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

  1. Supply the target ADS table name in the job's writer parameter (correct 'table' key).
  2. If table comes from an array/list, verify it is non-empty before index access.
  3. 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

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.