alibaba/DataX · error · IllegalArgumentException

columnDataType={columnDataType}

Error message

columnDataType={columnDataType}

What it means

Thrown by TableMetaHelper's column-type mapping switch when the incoming ColumnDataType value matches none of the known cases (numeric types, date/time/timestamp, string, multi-value). It is a defensive default branch indicating the switch was extended incompletely or an unrecognized type constant reached the mapper. The message interpolates the offending columnDataType value.

Source

Thrown at adswriter/src/main/java/com/alibaba/datax/plugin/writer/adswriter/load/TableMetaHelper.java:77

            case ColumnDataType.SHORT:
            case ColumnDataType.INT:
            case ColumnDataType.LONG:
                type = DataType.INTEGER;
                break;
            case ColumnDataType.DECIMAL:
            case ColumnDataType.DOUBLE:
            case ColumnDataType.FLOAT:
                type = DataType.DOUBLE;
                break;
            case ColumnDataType.DATE:
            case ColumnDataType.TIME:
            case ColumnDataType.TIMESTAMP:
            case ColumnDataType.STRING:
            case ColumnDataType.MULTI_VALUE:
                type = DataType.STRING;
                break;
            default:
                throw new IllegalArgumentException("columnDataType=" + columnDataType);
        }
        return DataType.toString(type);
    }

    private static String generateTempTableName(String tableSchema, String tableName) {
        int randNum = 1000 + new Random(System.currentTimeMillis()).nextInt(1000);
        return tableSchema + "__" + tableName + "_" + System.currentTimeMillis() + randNum;
    }

}

View on GitHub (pinned to 80ec23d5c5)

Solutions

  1. Log or print the columnDataType value in the exception to identify which type is unmapped
  2. If a legitimate new type, add a case to the switch in TableMetaHelper (map to DOUBLE, STRING, etc. as appropriate) and rebuild the plugin
  3. As a workaround, cast/exclude the offending column in the reader/writer column configuration so the unmapped type never reaches the mapper
  4. Align DataX plugin versions so reader and adswriter agree on ColumnDataType constants

Example fix

// before
default:
    throw new IllegalArgumentException("columnDataType=" + columnDataType);
// after (example: support new type)
case ColumnDataType.NEWTYPE:
    type = DataType.STRING;
    break;
default:
    throw new IllegalArgumentException("columnDataType=" + columnDataType);
Defensive patterns

Strategy: try-catch

Validate before calling

// if you control the metadata source, whitelist types before mapping
Set<ColumnDataType> supported = EnumSet.of(DOUBLE, FLOAT, DATE, TIME, TIMESTAMP, STRING, MULTI_VALUE /* ... */);
if (!supported.contains(columnDataType)) { /* exclude column or fail with clear message */ }

Try / catch

catch (IllegalArgumentException e) {
  if (e.getMessage().startsWith("columnDataType=")) {
    // log offending type + column, exclude or remap the column, fail the task with context
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling the type-mapping method with a ColumnDataType constant not covered by the switch — e.g. a newly added type (like a new interval/geometry type) or an unexpected byte/ordinal value from the metadata source.

Common situations: Upgrading DataX or the metadata provider introduces a new column data type that this adswriter build's switch does not handle; corrupted metadata producing an out-of-range type ordinal.

Related errors


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