{"record":{"id":"79de2c071c589db0","repo":"apache/druid","slug":"resultformat-s-is-not-supported","errorCode":null,"errorMessage":"resultFormat[%s] is not supported","messagePattern":"resultFormat\\[(.+?)\\] is not supported","errorType":"exception","errorClass":"UnsupportedOperationException (UOE)","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/query/scan/ScanQueryEngine.java","lineNumber":183,"sourceCode":"\n              @Override\n              public ScanResultValue next()\n              {\n                if (!hasNext()) {\n                  throw new NoSuchElementException();\n                }\n                if (hasTimeout && System.currentTimeMillis() >= timeoutAt) {\n                  throw new QueryTimeoutException(StringUtils.nonStrictFormat(\"Query [%s] timed out\", query.getId()));\n                }\n                final long lastOffset = offset;\n                final Object events;\n                final ScanQuery.ResultFormat resultFormat = query.getResultFormat();\n                if (ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST.equals(resultFormat)) {\n                  events = rowsToCompactedList();\n                } else if (ScanQuery.ResultFormat.RESULT_FORMAT_LIST.equals(resultFormat)) {\n                  events = rowsToList();\n                } else {\n                  throw new UOE(\"resultFormat[%s] is not supported\", resultFormat.toString());\n                }\n                responseContext.addRowScanCount(offset - lastOffset);\n                return new ScanResultValue(\n                    segment.getId() == null ? null : segment.getId().toString(),\n                    allColumns,\n                    events,\n                    rowSignatureBuilder.build()\n                );\n              }\n\n              @Override\n              public void remove()\n              {\n                throw new UnsupportedOperationException();\n              }\n\n              private List<List<Object>> rowsToCompactedList()\n              {","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/query/scan/ScanQueryEngine.java#L165-L201","documentation":"ScanQueryEngine only implements the 'list' and 'compactedList' result formats in its iterator; any other value of resultFormat (including valueVector) is rejected with UOE. The format is set via the query's resultFormat property.","triggerScenarios":"Issuing a scan query with resultFormat set to an unsupported value such as \"valueVector\" against the native scan engine path that lacks support for it.","commonSituations":"Copy-pasting resultFormat from MSQ/SQL documentation into native scan queries; clients auto-setting resultFormat=valueVector expecting vectorized results; typos like \"listx\" caught elsewhere but custom formats failing here.","solutions":["Set resultFormat to \"list\" or \"compactedList\"","Remove the resultFormat property to use the default","Use the SQL/MSQ engine if vectorized output is required"],"exampleFix":"// before\n{\"queryType\":\"scan\",\"resultFormat\":\"valueVector\",...}\n// after\n{\"queryType\":\"scan\",\"resultFormat\":\"compactedList\",...}","handlingStrategy":"validation","validationCode":"if (!\"list\".equals(fmt) && !\"compactedList\".equals(fmt)) {\n  throw new IllegalArgumentException(\"resultFormat must be list or compactedList\");\n}","typeGuard":"boolean supportedFormat(ScanQuery q) {\n  return q.getResultFormat() == ScanQuery.ResultFormat.RESULT_FORMAT_LIST\n      || q.getResultFormat() == ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST;\n}","tryCatchPattern":"try {\n  engine.process(query, segment, responseContext);\n} catch (UnsupportedOperationException e) {\n  // fall back to default resultFormat\n}","preventionTips":["Restrict resultFormat to known-supported enum values in clients","Rely on the default instead of setting resultFormat explicitly","Check engine (native vs MSQ) before choosing vectorized formats"],"tags":["druid","scan-query","unsupported-value","result-format"],"backgroundTag":"unsupported-enum-value","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"}