apache/druid · error · IllegalArgumentException

Caching is not supported. Check `isCacheable` before…

Error message

Caching is not supported. Check `isCacheable` before calling computeCacheKey

What it means

IndexedTable's default computeCacheKey() throws because not every joinable table supports caching. The table contract requires callers to check isCacheable() first; calling computeCacheKey() on a non-cacheable table is a programming error, so the default implementation fails fast with IllegalArgumentException.

Solutions

  1. Call table.isCacheable() before invoking computeCacheKey() and skip caching when false
  2. Override computeCacheKey() and isCacheable() consistently in your IndexedTable implementation
  3. If the table should be cacheable, ensure it has valid key columns and a cache key configured at construction

Example fix

// before
byte[] cacheKey = table.computeCacheKey();
// after
if (table.isCacheable()) {
  byte[] cacheKey = table.computeCacheKey();
} else {
  // skip caching for this table
}
Defensive patterns

Strategy: validation

Validate before calling

if (table.isCacheable()) { byte[] key = table.computeCacheKey(); }

Type guard

boolean cacheable = table.isCacheable();

Prevention

When it happens

Trigger: Calling computeCacheKey() directly on an IndexedTable implementation that does not override it (or whose isCacheable() returns false), e.g. when building a cache key for a join query against a non-cacheable broadcast table.

Common situations: Custom IndexedTable implementations that rely on the default methods while enabling query caching; internal code paths that construct cache keys for join queries without the isCacheable() guard; table providers that report cache keys for tables lacking key columns.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at processing/src/main/java/org/apache/druid/segment/join/table/IndexedTable.java:103

   * instead.
   */
  @Nullable
  default ColumnSelectorFactory makeColumnSelectorFactory(ReadableOffset offset, Closer closer)
  {
    return null;
  }

  /**
   * Computes a {@code byte[]} key for the table that can be used for computing cache keys for join operations.
   * see {@link org.apache.druid.segment.join.JoinableFactory#computeJoinCacheKey}
   *
   * @return the byte array for cache key
   *
   * @throws {@link IAE} if caching is not supported
   */
  default byte[] computeCacheKey()
  {
    throw new IAE("Caching is not supported. Check `isCacheable` before calling computeCacheKey");
  }

  /**
   * Returns whether this indexed table can be cached for the join operations
   */
  default boolean isCacheable()
  {
    return false;
  }

  /**
   * Indexes support fast lookups on key columns.
   */
  interface Index
  {
    int NOT_FOUND = -1;

    /**

View on GitHub (pinned to 9b90983fd2)