prestodb/presto · error · PrestoException

NOT_SUPPORTED

NOT_SUPPORTED

Error message

Temporary table cannot be created in catalog "%s": %s

What it means

When the planner needs to materialize an exchange as a temporary table in a remote catalog, it calls the connector's metadata createTemporaryTable. If the connector rejects this with NOT_SUPPORTED, Presto rethrows a clearer message naming the catalog. The storage the query runs on does not support temporary/staging tables needed by this plan shape.

Source

Thrown at presto-main-base/src/main/java/com/facebook/presto/sql/planner/BasePlanFragmenter.java:486

                session, connectorId.getCatalogName(), exchange.getOutputVariables(), partitioningVariableAssignments.getConstants().keySet());
        List<VariableReferenceExpression> partitioningVariables = partitioningVariableAssignments.getVariables();
        List<String> partitionColumns = partitioningVariables.stream()
                .map(variable -> variableToColumnMap.get(variable).getName())
                .collect(toImmutableList());
        PartitioningMetadata partitioningMetadata = new PartitioningMetadata(partitioningHandle, partitionColumns);

        TableHandle temporaryTableHandle;

        try {
            temporaryTableHandle = metadata.createTemporaryTable(
                    session,
                    connectorId.getCatalogName(),
                    ImmutableList.copyOf(variableToColumnMap.values()),
                    Optional.of(partitioningMetadata));
        }
        catch (PrestoException e) {
            if (e.getErrorCode().equals(NOT_SUPPORTED.toErrorCode())) {
                throw new PrestoException(
                        NOT_SUPPORTED,
                        format("Temporary table cannot be created in catalog \"%s\": %s", connectorId.getCatalogName(), e.getMessage()),
                        e);
            }
            throw e;
        }

        TableScanNode scan = createTemporaryTableScan(
                metadata,
                session,
                idAllocator,
                exchange.getSourceLocation(),
                temporaryTableHandle,
                exchange.getOutputVariables(),
                variableToColumnMap,
                Optional.of(partitioningMetadata),
                Optional.empty());

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Point the query at a catalog that supports temporary tables (e.g. Hive/Iceberg-backed) for the materialized exchange
  2. Configure the connector's temporary/staging storage (e.g. temp table schema or spooling storage location) per connector docs
  3. Disable the plan feature requiring exchange materialization (e.g. turn off spooling operator or adjust query-type/engine settings)

Example fix

// session example
// before
SET SESSION spooling_operator_enabled = true; -- against a catalog without temp table support
// after
SET SESSION spooling_operator_enabled = false;
-- or route the query to a catalog with temp storage configured
Defensive patterns

Strategy: try-catch

Validate before calling

// Before relying on remote materialization, verify connector temp-table support
try {
    metadata.createTemporaryTable(session, catalogName, ...);
} catch (PrestoException e) {
    if (e.getErrorCode().equals(NOT_SUPPORTED.toErrorCode())) {
        // fall back to a different catalog or disable materialization
    }
}

Try / catch

try { runQuery(sql); } catch (PrestoException e) { if (e.getErrorCode().equals(NOT_SUPPORTED.toErrorCode()) && e.getMessage().contains("Temporary table cannot be created")) { /* re-target to a catalog with temp storage or disable spooling */ } else throw e; }

Prevention

When it happens

Trigger: A distributed query whose plan fragment requires remote materialization (e.g. certain spooling/aggregation or external-s exchange strategies) against a catalog whose connector lacks temporary-table support (or lacks a configured temp storage location).

Common situations: Running queries against connectors like Redis, Kafka, or custom connectors with no writable temp storage; missing session/catalog configuration for a temporary table schema; enabling exchange materialization features (e.g. fault-tolerant execution or spooling operators) on catalogs that cannot host temp tables.

Understand the failure class

Background: Presto NOT_SUPPORTED error: what "not supported" means and how to fix it — this error's family across 3 libraries.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/430a7007047c3acd. Report an issue: GitHub.