apache/druid · error · ResourceLimitException

Unknown type[ ]

Error message

Unknown type[%s]

What it means

DefaultSortedMatrixMaker.findRow binary-searches a sorted matrix for a row by comparing each column via a searcher; the searcher's declared type must be one of the handled cases (string-like, numeric, ARRAY, COMPLEX, etc.). An unrecognized ColumnType falls into default and throws RE. This happens when a column's type has no binary-search implementation.

Solutions

  1. Use a supported column type (long, double, float, string, array, complex) for the involved columns
  2. Check the actual column type in the segment schema and cast if needed
  3. Upgrade Druid — newer versions handle more types
Defensive patterns

Strategy: validation

Validate before calling

switch (columnType) {
  case STRING: case LONG: case DOUBLE: case FLOAT:
  case ARRAY: case COMPLEX: break;
  default:
    throw new IllegalArgumentException("unsupported type for sorted matrix: " + columnType);
}

Try / catch

try {
  matrix = maker.make();
} catch (ResourceLimitException | RuntimeException e) {
  if (e.getMessage().startsWith("Unknown type")) {
    // cast or exclude the offending column
    matrix = maker.withColumnRemoved(offendingColumn).make();
  } else throw e;
}

Prevention

When it happens

Trigger: A column in the sorted matrix has a type (per searcher.getType()) that the switch in findRow does not handle, commonly exotic/complex column types.

Common situations: New or extension-provided column types used in GROUP BY/matrix contexts; schema type mismatch where a column resolved to an unexpected type.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/7ad9ce13fb6ecf6b. Report an issue: GitHub.

Appendix: source

Thrown at processing/src/main/java/org/apache/druid/query/rowsandcols/semantic/DefaultSortedMatrixMaker.java:188

                if (row.isNull(i)) {
                  result = searcher.findNull(start, end);
                } else {
                  result = searcher.findLong(start, end, row.getLong(i));
                }
                break;
              case DOUBLE:
                result = searcher.findDouble(start, end, row.getDouble(i));
                break;
              case FLOAT:
                result = searcher.findFloat(start, end, row.getFloat(i));
                break;

              case ARRAY:
              case COMPLEX:
                result = searcher.findComplex(start, end, row.getObject(i));
                break;
              default:
                throw new RE("Unknown type[%s]", searcher.getType());
            }
          }

          if (result.wasFound()) {
            start = result.getStartRow();
            end = result.getEndRow();
          } else {
            return FindResult.notFound(result.getNext());
          }
        }

        return FindResult.found(start, end);
      }
    };
  }
}

View on GitHub (pinned to 9b90983fd2)