alibaba/DataX · error · AdsException

-405

-405

Error message

Table is null.

What it means

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.

Source

Thrown at adswriter/src/main/java/com/alibaba/datax/plugin/writer/adswriter/load/AdsHelper.java:89

    public String getSchema() {
        return schema;
    }

    public void setSchema(String schema) {
        this.schema = schema;
    }

    /**
     * Obtain the table meta information.
     * 
     * @param table The table
     * @return The table meta information
     * @throws com.alibaba.datax.plugin.writer.adswriter.AdsException
     */
    public TableInfo getTableInfo(String table) throws AdsException {

        if (table == null) {
            throw new AdsException(AdsException.ADS_TABLEMETA_TABLE_NULL, "Table 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) {
            throw new AdsException(AdsException.ADS_CONN_SCHEMA_NOT_SET, "ADS JDBC connection schema was not set.",

View on GitHub (pinned to 80ec23d5c5)

Solutions

  1. Add the correct 'table' key (with the ADS table name string) to the writer parameter block of the job JSON.
  2. Verify the exact key spelling the plugin version expects (table, not tableName).
  3. If calling AdsHelper directly, pass a non-null table argument or set it before getTableInfo.

Example fix

// before
{"name":"adswriter","parameter":{"url":"..."}}
// after
{"name":"adswriter","parameter":{"url":"...","table":"my_ads_table"}}
Defensive patterns

Strategy: validation

Validate before calling

if (helper == null || !helper.isTableSet() /* or */ config.getString("table") == null) {
    throw new IllegalStateException("adswriter 'table' key is required");
}

Type guard

boolean hasTable(String table) { return table != null && !table.trim().isEmpty(); }

Try / catch

try {
    return helper.getTableInfo(table);
} catch (AdsException e) {
    if (e.getCode() == AdsException.ADS_TABLEMETA_TABLE_NULL) {
        throw new IllegalStateException("job config: 'table' missing for adswriter", e);
    }
    throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of alibaba/DataX@80ec23d5c5 (2026-08-14). Data as JSON: /api/errors/772c7532d17eee0d. Report an issue: GitHub.