{"record":{"id":"9693190d079a42b3","repo":"apache/druid","slug":"not-a-numeric-value-type","errorCode":null,"errorMessage":"Not a numeric value type: ","messagePattern":"Not a numeric value type: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/segment/column/ValueTypes.java","lineNumber":69,"sourceCode":"        return new SettableObjectColumnValueSelector<>();\n    }\n  }\n\n  public static DimensionSelector makeNumericWrappingDimensionSelector(\n      ValueType valueType,\n      ColumnValueSelector<?> numericColumnValueSelector,\n      @Nullable ExtractionFn extractionFn\n  )\n  {\n    switch (valueType) {\n      case DOUBLE:\n        return new DoubleWrappingDimensionSelector(numericColumnValueSelector, extractionFn);\n      case FLOAT:\n        return new FloatWrappingDimensionSelector(numericColumnValueSelector, extractionFn);\n      case LONG:\n        return new LongWrappingDimensionSelector(numericColumnValueSelector, extractionFn);\n      default:\n        throw new UnsupportedOperationException(\"Not a numeric value type: \" + valueType.name());\n    }\n  }\n\n  private ValueTypes()\n  {\n    // no instantiation\n  }\n}\n","sourceCodeStart":51,"sourceCodeEnd":78,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/segment/column/ValueTypes.java#L51-L78","documentation":"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.","triggerScenarios":"Calling makeNumericWrappingDimensionSelector with a column whose ValueType is STRING, COMPLEX, ARRAY, or otherwise non-numeric.","commonSituations":"Schema mismatches where a column is assumed numeric but is stored as string/complex; generic selector-creation code that skips capability checks.","solutions":["Verify ColumnCapabilities.getType() is LONG/DOUBLE/FLOAT before calling","Create a string or complex selector appropriate to the actual ValueType","Cast/convert data at ingestion so the column has the expected numeric type"],"exampleFix":"// before\nDimensionSelector sel = ValueTypes.makeNumericWrappingDimensionSelector(col, capabilities.getType(), null);\n// after\nif (capabilities.getType().isNumeric()) {\n  DimensionSelector sel = ValueTypes.makeNumericWrappingDimensionSelector(col, capabilities.getType(), null);\n}","handlingStrategy":"validation","validationCode":"if (valueType == ValueType.LONG || valueType == ValueType.DOUBLE || valueType == ValueType.FLOAT) { sel = ValueTypes.makeNumericWrappingDimensionSelector(col, valueType, fn); }","typeGuard":"boolean isNumeric(ValueType t) { return t == ValueType.LONG || t == ValueType.DOUBLE || t == ValueType.FLOAT; }","tryCatchPattern":"try { return ValueTypes.makeNumericWrappingDimensionSelector(col, valueType, fn); } catch (UnsupportedOperationException e) { return buildSelectorForType(col, valueType, fn); }","preventionTips":["Inspect ColumnCapabilities.getType() before creating selectors","Handle STRING/COMPLEX columns with their own selector paths","Validate ingestion schemas so numeric expectations match stored types"],"tags":["java","unsupported-operation","type-mismatch","segments"],"backgroundTag":"type-mismatch","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}