{"record":{"id":"53fb9a631f78ab07","repo":"apache/druid","slug":"cannot-create-query-type-helper-from-invalid-type-53fb9a","errorCode":null,"errorMessage":"Cannot create query type helper from invalid type [%s]","messagePattern":"Cannot create query type helper from invalid type \\[(.+?)\\]","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/query/search/SearchQueryRunner.java","lineNumber":85,"sourceCode":"  {\n    @Override\n    public SearchColumnSelectorStrategy makeColumnSelectorStrategy(\n        ColumnCapabilities capabilities,\n        ColumnValueSelector selector,\n        String dimension\n    )\n    {\n      switch (capabilities.getType()) {\n        case STRING:\n          return new StringSearchColumnSelectorStrategy();\n        case LONG:\n          return new LongSearchColumnSelectorStrategy();\n        case FLOAT:\n          return new FloatSearchColumnSelectorStrategy();\n        case DOUBLE:\n          return new DoubleSearchColumnSelectorStrategy();\n        default:\n          throw new IAE(\"Cannot create query type helper from invalid type [%s]\", capabilities.asTypeString());\n      }\n    }\n\n    @Override\n    public boolean supportsComplexTypes()\n    {\n      return false;\n    }\n  }\n\n  public interface SearchColumnSelectorStrategy<ValueSelectorType> extends ColumnSelectorStrategy\n  {\n    /**\n     * Read the current row from dimSelector and update the search result set.\n     * <p>\n     * For each row value:\n     * 1. Check if searchQuerySpec accept()s the value\n     * 2. If so, add the value to the result set and increment the counter for that value","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/query/search/SearchQueryRunner.java#L67-L103","documentation":"SearchQueryRunner's makeColumnSelectorStrategy switch handles only STRING, LONG, FLOAT, and DOUBLE column capabilities; any other type (e.g. COMPLEX) reaches the default branch and throws IAE('Cannot create query type helper from invalid type [%s]'). It means a search was attempted on a column whose data type the search machinery cannot scan directly. Searching complex columns (e.g. nested/sketch columns) triggers it.","triggerScenarios":"Issuing a search query with dimensions referencing a COMPLEX or otherwise unsupported column type; schema changes leaving a column type unsupported by search strategies.","commonSituations":"Searching nested or metric (complex aggregator) columns; auto-detection assigning unexpected types during ingestion; typos hitting a complex column instead of a string dimension.","solutions":["Restrict the search query's dimensions to string/long/float/double columns","Use a virtual column or expression (e.g. JSON path expressions) to search inside complex columns","Fix ingestion specs so the target column has a supported type, or re-ingest with the right type"],"exampleFix":"// before\n{\"queryType\":\"search\",\"dimensions\":[\"complexMetricColumn\"]}\n// after\n{\"queryType\":\"search\",\"dimensions\":[\"stringDimension\"]} // or a nested virtual column","handlingStrategy":"validation","validationCode":"ColumnCapabilities caps = selector.getColumnCapabilities(dim); if (caps == null || !EnumSet.of(STRING, LONG, FLOAT, DOUBLE).contains(caps.getType())) { throw new IllegalArgumentException(\"unsupported search column: \" + dim); }","typeGuard":"boolean isSearchableType(ColumnCapabilities c) { return c != null && (c.getType() == ValueType.STRING || c.getType() == ValueType.LONG || c.getType() == ValueType.FLOAT || c.getType() == ValueType.DOUBLE); }","tryCatchPattern":"try { runner.run(queryPlus, ctx); } catch (IAE e) { if (e.getMessage().contains(\"invalid type\")) { rewriteQueryWithSupportedColumns(); } else throw e; }","preventionTips":["Check column types via segment metadata before issuing search queries","Use virtual columns/expressions for complex columns","Keep ingestion schemas aligned with the columns you search"],"tags":["search-query","column-type","unsupported-dtype"],"backgroundTag":"unsupported-dtype","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"}