{"record":{"id":"e525c641f4c997b4","repo":"apache/druid","slug":"cannot-create-dimension-for-type-s","errorCode":null,"errorMessage":"Cannot create dimension for type[%s]","messagePattern":"Cannot create dimension for type\\[(.+?)\\]","errorType":"exception","errorClass":"ISE","httpStatus":null,"severity":"error","filePath":"multi-stage-query/src/main/java/org/apache/druid/msq/util/DimensionSchemaUtils.java","lineNumber":157,"sourceCode":"             .emit();\n          return ColumnType.STRING;\n        } else {\n          return queryType;\n        }\n      } else if (elementType.isNumeric()) {\n        // ValueType == LONG || ValueType == FLOAT || ValueType == DOUBLE\n        if (arrayIngestMode == ArrayIngestMode.ARRAY) {\n          return queryType;\n        } else {\n          throw InvalidInput.exception(\n              \"Numeric arrays can only be ingested when '%s' is set to 'array'. \"\n              + \"Current value of the parameter is[%s]\",\n              MultiStageQueryContext.CTX_ARRAY_INGEST_MODE,\n              StringUtils.toLowerCase(arrayIngestMode.name())\n          );\n        }\n      } else {\n        throw new ISE(\"Cannot create dimension for type[%s]\", queryType.toString());\n      }\n    } else {\n      return queryType;\n    }\n  }\n}\n","sourceCodeStart":139,"sourceCodeEnd":164,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/multi-stage-query/src/main/java/org/apache/druid/msq/util/DimensionSchemaUtils.java#L139-L164","documentation":"DimensionSchemaUtils.getDimensionType maps a query-side column type to a DimensionSchema multi-value/array type; when the given DruidType (queryType) has no corresponding dimension schema representation, this ISE is thrown.","triggerScenarios":"Translating a native query with an input column whose type is not a string, long, float, double, or supported array type (e.g. an unsupported complex type) during MSQ ingestion spec generation.","commonSituations":"Ingesting into a column typed as a nested/complex type the MSQ dimension mapping does not support; using an unusual column type in an INSERT/REPLACE via sql-msq; version gaps where new types aren't yet mapped.","solutions":["Change the column type to a supported one (string, long, float, double, or supported arrays)","Set the array ingest mode explicitly (arrayIngestMode in the query context) so array types map correctly","Check the Druid version for MSQ type-mapping support of the type in question and upgrade if needed","Cast the offending column to a supported type in the SQL query"],"exampleFix":"// before\nINSERT INTO dst SELECT ARRAY_AGG(x) ... -- complex type unmapped\n// after\nINSERT INTO dst SELECT ARRAY_AGG(CAST(x AS VARCHAR)) ...","handlingStrategy":"validation","validationCode":"// verify column type is supported before INSERT/REPLACE\nSet<String> supported = Set.of(\"STRING\",\"LONG\",\"FLOAT\",\"DOUBLE\",\"ARRAY<STRING>\",\"ARRAY<LONG>\",\"ARRAY<DOUBLE>\");\nif (!supported.contains(columnType.toUpperCase())) {\n  throw new IllegalArgumentException(\"Unsupported MSQ dimension type: \" + columnType);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cast unsupported types to supported ones in the SQL","Set arrayIngestMode explicitly for array columns","Check release notes for newly supported MSQ types"],"tags":["msq","type-mapping","ingestion"],"backgroundTag":"unsupported-operation","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}