{"record":{"id":"95a399eabbd91dd9","repo":"apache/druid","slug":"cannot-handle-column-s-with-type-s","errorCode":null,"errorMessage":"Cannot handle column [%s] with type [%s]","messagePattern":"Cannot handle column \\[(.+?)\\] with type \\[(.+?)\\]","errorType":"exception","errorClass":"UnsupportedColumnTypeException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/frame/field/FieldReaders.java","lineNumber":78,"sourceCode":"      case COMPLEX:\n        return ComplexFieldReader.createFromType(columnType);\n\n      case ARRAY:\n        switch (Preconditions.checkNotNull(columnType.getElementType().getType(), \"array elementType\")) {\n          case STRING:\n            return new StringArrayFieldReader();\n\n          case LONG:\n            return new LongArrayFieldReader();\n\n          case FLOAT:\n            return new FloatArrayFieldReader(frameType);\n\n          case DOUBLE:\n            return new DoubleArrayFieldReader(frameType);\n\n          default:\n            throw new UnsupportedColumnTypeException(columnName, columnType);\n\n        }\n        // Fall through to error for other array types\n\n      default:\n        throw new UnsupportedColumnTypeException(columnName, columnType);\n    }\n  }\n}\n","sourceCodeStart":60,"sourceCodeEnd":88,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/frame/field/FieldReaders.java#L60-L88","documentation":"FieldReaders.create dispatches on a column's ColumnType to build the matching frame field reader; array subtypes fall through to a default arm that throws UnsupportedColumnTypeException (message 'Cannot handle column [%s] with type [%s]'). This error [986] corresponds to the array-switch default: an array column of a leaf type the frame format cannot represent.","triggerScenarios":"Calling FieldReaders.create(columnName, columnType) for an ARRAY column whose element type is unsupported by the frame readers (the switch handles LONG/FLOAT/DOUBLE arrays; other array element types hit the default).","commonSituations":"Attempting to write/query frames containing exotic array types (e.g. string arrays or complex arrays) that the frame processor does not support; ingest producing array columns from nested data and then materializing them as frames (MSQ shuffle).","solutions":["Check the actual column type in the error message; avoid materializing that type into frames (cast or flatten the column first).","Use only supported array element types (LONG/FLOAT/DOUBLE arrays) in queries routed through the frame processor.","If string/complex arrays are needed, keep them out of MSQ frame shuffles or convert to a supported representation.","Upgrade Druid if a newer version added reader support for that array type."],"exampleFix":"// before\nSELECT arr_col FROM ...  -- arr_col is VARCHAR ARRAY, fails in frame creation\n// after\nSELECT ARRAY_TO_STRING(arr_col, ',') AS arr_col FROM ...  -- or ARRAY_LONG cast","handlingStrategy":"validation","validationCode":"if (columnType != null && columnType.getType() == ValueType.ARRAY\n    && !EnumSet.of(ValueType.LONG, ValueType.FLOAT, ValueType.DOUBLE).contains(columnType.getElementType().getType())) {\n  throw new IllegalStateException(\"array element type not frame-supported: \" + columnType);\n}","typeGuard":null,"tryCatchPattern":"try { FieldReaders.create(name, t); } catch (UnsupportedColumnTypeException e) { /* coerce/cast column or fall back to non-frame path */ }","preventionTips":["Restrict frame-shuffled columns to LONG/FLOAT/DOUBLE arrays","Cast unsupported arrays (e.g. to VARCHAR or ARRAY<DOUBLE>) upstream","Check ColumnType support before planning MSQ stages"],"tags":["column-type","frames","unsupported-type"],"backgroundTag":"unsupported-operation","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"}