prestodb/presto · error · PrestoException

NOT_SUPPORTED

NOT_SUPPORTED

Error message

catalog does not support page sink commit: 

What it means

Thrown when finalizing a query whose writer target requires page-sink commit but the target catalog's connector does not declare the SUPPORTS_PAGE_SINK_COMMIT capability. Presto-on-Spark commits table writes via the page sink commit protocol, so catalogs without that capability cannot be written to through this execution path.

Source

Thrown at presto-spark-base/src/main/java/com/facebook/presto/spark/execution/AbstractPrestoSparkQueryExecution.java:886

        if (writerTarget instanceof ExecutionWriterTarget.DeleteHandle) {
            connectorId = ((ExecutionWriterTarget.DeleteHandle) writerTarget).getHandle().getConnectorId();
        }
        else if (writerTarget instanceof ExecutionWriterTarget.CreateHandle) {
            connectorId = ((ExecutionWriterTarget.CreateHandle) writerTarget).getHandle().getConnectorId();
        }
        else if (writerTarget instanceof ExecutionWriterTarget.InsertHandle) {
            connectorId = ((ExecutionWriterTarget.InsertHandle) writerTarget).getHandle().getConnectorId();
        }
        else if (writerTarget instanceof ExecutionWriterTarget.RefreshMaterializedViewHandle) {
            connectorId = ((ExecutionWriterTarget.RefreshMaterializedViewHandle) writerTarget).getHandle().getConnectorId();
        }
        else {
            throw new IllegalArgumentException("unexpected writer target type: " + writerTarget.getClass());
        }
        verify(connectorId != null, "connectorId is null");
        Set<ConnectorCapabilities> connectorCapabilities = metadata.getConnectorCapabilities(session, connectorId);
        if (!connectorCapabilities.contains(SUPPORTS_PAGE_SINK_COMMIT)) {
            throw new PrestoException(NOT_SUPPORTED, "catalog does not support page sink commit: " + connectorId);
        }
    }

    // Returns RDD for specified fragmented SubPlan
    // This method ensures that RDD is created only once for a sub-plan, where identity is determined by fragment id
    // For broadcast RDDs, it returns RDD to be broadcasted.
    protected synchronized <T extends PrestoSparkTaskOutput> RddAndMore<T> createRddForSubPlan(SubPlan subPlan,
            TableWriteInfo tableWriteInfo,
            Optional<Class<?>> outputTypeOptional)
            throws SparkException, TimeoutException
    {
        if (fragmentIdToRdd.containsKey(subPlan.getFragment().getId())) {
            return fragmentIdToRdd.get(subPlan.getFragment().getId());
        }

        ImmutableMap.Builder<PlanFragmentId, JavaPairRDD<MutablePartitionId, PrestoSparkMutableRow>> rddInputs = ImmutableMap.builder();
        ImmutableMap.Builder<PlanFragmentId, Broadcast<?>> broadcastInputs = ImmutableMap.builder();
        ImmutableList.Builder<PrestoSparkBroadcastDependency<?>> broadcastDependencies = ImmutableList.builder();

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Use a connector version that declares SUPPORTS_PAGE_SINK_COMMIT for the target catalog
  2. Upgrade/redeploy the connector plugin on the Spark cluster to match the coordinator
  3. Route the write through a catalog/connector that supports page sink commit
  4. If you own the connector, implement and expose the SUPPORTS_PAGE_SINK_COMMIT capability

Example fix

// connector side, before
class MyConnectorMetadata ... // no capabilities declared
// after
@Override
public Set<ConnectorCapabilities> getCapabilities() {
    return ImmutableSet.of(SUPPORTS_PAGE_SINK_COMMIT);
}
Defensive patterns

Strategy: validation

Validate before calling

Set<ConnectorCapabilities> caps = metadata.getConnectorCapabilities(session, connectorId);
if (!caps.contains(ConnectorCapabilities.SUPPORTS_PAGE_SINK_COMMIT)) {
    throw new IllegalStateException("catalog " + connectorId + " cannot be used as write target here");
}

Type guard

boolean supportsPageSinkCommit(ConnectorMetadata metadata, ConnectorSession session, CatalogSchemaTableName target) {
    return metadata.getConnectorCapabilities(session, target.getCatalogName())
        .contains(ConnectorCapabilities.SUPPORTS_PAGE_SINK_COMMIT);
}

Try / catch

try {
    queryExecution.execute();
}
catch (PrestoException e) {
    if (NOT_SUPPORTED.toErrorCode().getCode().equals(e.getErrorCode().getCode()) && e.getMessage().startsWith("catalog does not support page sink commit")) {
        // rewrite query against a supported catalog
    }
    throw e;
}

Prevention

When it happens

Trigger: Constructor of AbstractPrestoSparkQueryExecution validates the writer target: metadata.getConnectorCapabilities(session, connectorId) lacks ConnectorCapabilities.SUPPORTS_PAGE_SINK_COMMIT while the plan ends in a page-sink commit writer target.

Common situations: Writing to a connector that does not implement the page sink commit protocol (older or third-party connectors); mismatched connector/plugin versions where the capability was renamed or not yet implemented.

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/6d97e6fdb0e482f8. Report an issue: GitHub.