{"record":{"id":"bc1365ddcdd8fe09","repo":"apache/druid","slug":"scan-query-result-format-s-is-not-supported","errorCode":null,"errorMessage":"Scan query result format [%s] is not supported.","messagePattern":"Scan query result format \\[(.+?)\\] is not supported\\.","errorType":"validation","errorClass":"UnsupportedOperationException (UOE)","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/query/scan/ScanQuery.java","lineNumber":96,"sourceCode":"        case RESULT_FORMAT_VALUE_VECTOR:\n          return \"valueVector\";\n        default:\n          return \"\";\n      }\n    }\n\n    @JsonCreator\n    public static ResultFormat fromString(String name)\n    {\n      switch (name) {\n        case \"compactedList\":\n          return RESULT_FORMAT_COMPACTED_LIST;\n        case \"valueVector\":\n          return RESULT_FORMAT_VALUE_VECTOR;\n        case \"list\":\n          return RESULT_FORMAT_LIST;\n        default:\n          throw new UOE(\"Scan query result format [%s] is not supported.\", name);\n      }\n    }\n  }\n\n  /**\n   * This context flag corresponds to whether the query is running on the \"outermost\" process (i.e. the process\n   * the query is sent to).\n   */\n  public static final String CTX_KEY_OUTERMOST = \"scanOutermost\";\n  public static final int DEFAULT_BATCH_SIZE = 4096 * 5;\n\n  private final VirtualColumns virtualColumns;\n  private final ResultFormat resultFormat;\n  private final int batchSize;\n  private final long scanRowsOffset;\n  private final long scanRowsLimit;\n  private final DimFilter dimFilter;\n  private final List<String> columns;","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/query/scan/ScanQuery.java#L78-L114","documentation":"ScanQuery.ResultFormat.fromString maps the resultFormat string of a scan query to an enum. Only compactedList, valueVector, list (and their constants) are accepted; anything else throws UOE. This validates the query-level scan result format before results are serialized.","triggerScenarios":"A scan query JSON contains \"resultFormat\": \"<unsupported>\" (typo or format unsupported by this Druid version) passed through ResultFormat.fromString.","commonSituations":"Client sending \"array\" or \"csv\" (not supported for scan) ; typo like \"compactedlist\"; newer client formats against an older server.","solutions":["Use one of: compactedList, list, valueVector","Check the server's supported formats for the version in use","Fix the resultFormat field in the query JSON"],"exampleFix":"// before\n{\"queryType\":\"scan\",\"resultFormat\":\"csv\", ...}\n// after\n{\"queryType\":\"scan\",\"resultFormat\":\"compactedList\", ...}","handlingStrategy":"validation","validationCode":"final Set<String> VALID_FORMATS = Set.of(\"compactedList\",\"list\",\"valueVector\");\nif (!VALID_FORMATS.contains(query.getResultFormat())) {\n  throw new IllegalArgumentException(\"unsupported scan resultFormat: \" + query.getResultFormat());\n}","typeGuard":null,"tryCatchPattern":"try {\n  submitScanQuery(q);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().contains(\"result format\") && e.getMessage().contains(\"not supported\")) {\n    submitScanQuery(q.withResultFormat(\"compactedList\"));\n  } else throw e;\n}","preventionTips":["Only use resultFormat values documented for the server version","Prefer compactedList for max compatibility"],"tags":["scan-query","result-format","invalid-enum"],"backgroundTag":"invalid-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"}