apache/druid · error · UnsupportedOperationException

Not a numeric value type:

Error message

Not a numeric value type: 

What it means

ValueTypes.makeNumericWrappingDimensionSelector wraps a numeric column ValueSelector into a Double/Float/Long-wrapping DimensionSelector. The default branch throws UnsupportedOperationException because the ValueType is not a numeric type, so no numeric wrapper exists.

Source

Thrown at processing/src/main/java/org/apache/druid/segment/column/ValueTypes.java:69

        return new SettableObjectColumnValueSelector<>();
    }
  }

  public static DimensionSelector makeNumericWrappingDimensionSelector(
      ValueType valueType,
      ColumnValueSelector<?> numericColumnValueSelector,
      @Nullable ExtractionFn extractionFn
  )
  {
    switch (valueType) {
      case DOUBLE:
        return new DoubleWrappingDimensionSelector(numericColumnValueSelector, extractionFn);
      case FLOAT:
        return new FloatWrappingDimensionSelector(numericColumnValueSelector, extractionFn);
      case LONG:
        return new LongWrappingDimensionSelector(numericColumnValueSelector, extractionFn);
      default:
        throw new UnsupportedOperationException("Not a numeric value type: " + valueType.name());
    }
  }

  private ValueTypes()
  {
    // no instantiation
  }
}

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Verify ColumnCapabilities.getType() is LONG/DOUBLE/FLOAT before calling
  2. Create a string or complex selector appropriate to the actual ValueType
  3. Cast/convert data at ingestion so the column has the expected numeric type

Example fix

// before
DimensionSelector sel = ValueTypes.makeNumericWrappingDimensionSelector(col, capabilities.getType(), null);
// after
if (capabilities.getType().isNumeric()) {
  DimensionSelector sel = ValueTypes.makeNumericWrappingDimensionSelector(col, capabilities.getType(), null);
}
Defensive patterns

Strategy: validation

Validate before calling

if (valueType == ValueType.LONG || valueType == ValueType.DOUBLE || valueType == ValueType.FLOAT) { sel = ValueTypes.makeNumericWrappingDimensionSelector(col, valueType, fn); }

Type guard

boolean isNumeric(ValueType t) { return t == ValueType.LONG || t == ValueType.DOUBLE || t == ValueType.FLOAT; }

Try / catch

try { return ValueTypes.makeNumericWrappingDimensionSelector(col, valueType, fn); } catch (UnsupportedOperationException e) { return buildSelectorForType(col, valueType, fn); }

Prevention

When it happens

Trigger: Calling makeNumericWrappingDimensionSelector with a column whose ValueType is STRING, COMPLEX, ARRAY, or otherwise non-numeric.

Common situations: Schema mismatches where a column is assumed numeric but is stored as string/complex; generic selector-creation code that skips capability checks.

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/9693190d079a42b3. Report an issue: GitHub.