apache/druid · error · UnsupportedOperationException (UOE)
resultFormat[ ] is not supported
Error message
resultFormat[%s] is not supported
What it means
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.
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
Example fix
// before
{"queryType":"scan","resultFormat":"valueVector",...}
// after
{"queryType":"scan","resultFormat":"compactedList",...} Defensive patterns
Strategy: validation
Validate before calling
if (!"list".equals(fmt) && !"compactedList".equals(fmt)) {
throw new IllegalArgumentException("resultFormat must be list or compactedList");
} Type guard
boolean supportedFormat(ScanQuery q) {
return q.getResultFormat() == ScanQuery.ResultFormat.RESULT_FORMAT_LIST
|| q.getResultFormat() == ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST;
} Try / catch
try {
engine.process(query, segment, responseContext);
} catch (UnsupportedOperationException e) {
// fall back to default resultFormat
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- VALUE_VECTOR is not supported yet
- Cannot apply limit[ ] with offset[ ] due to overflow
- Cannot execute query with orderBy
- Cannot provide 'order' incompatible with 'orderBy'
- Column [ ] from 'orderBy' must also appear in 'columns'.
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/79de2c071c589db0.
Report an issue: GitHub.
Appendix: source
Thrown at processing/src/main/java/org/apache/druid/query/scan/ScanQueryEngine.java:183
@Override
public ScanResultValue next()
{
if (!hasNext()) {
throw new NoSuchElementException();
}
if (hasTimeout && System.currentTimeMillis() >= timeoutAt) {
throw new QueryTimeoutException(StringUtils.nonStrictFormat("Query [%s] timed out", query.getId()));
}
final long lastOffset = offset;
final Object events;
final ScanQuery.ResultFormat resultFormat = query.getResultFormat();
if (ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST.equals(resultFormat)) {
events = rowsToCompactedList();
} else if (ScanQuery.ResultFormat.RESULT_FORMAT_LIST.equals(resultFormat)) {
events = rowsToList();
} else {
throw new UOE("resultFormat[%s] is not supported", resultFormat.toString());
}
responseContext.addRowScanCount(offset - lastOffset);
return new ScanResultValue(
segment.getId() == null ? null : segment.getId().toString(),
allColumns,
events,
rowSignatureBuilder.build()
);
}
@Override
public void remove()
{
throw new UnsupportedOperationException();
}
private List<List<Object>> rowsToCompactedList()
{View on GitHub (pinned to 9b90983fd2)