prestodb/presto · error · UnsupportedOperationException

grouped execution is not supported in presto on spark

Error message

grouped execution is not supported in presto on spark

What it means

Presto on Spark does not support grouped execution (stage grouped execution with dynamic bucketed node assignment). PrestoSparkNodePartitioningManager.getNodePartitioningMap unconditionally throws UnsupportedOperationException because computing per-node partition maps for grouped execution is not implemented on Spark.

Source

Thrown at presto-spark-base/src/main/java/com/facebook/presto/spark/node/PrestoSparkNodePartitioningManager.java:58

        super(new PrestoSparkNodeScheduler(), partitioningProviderManager, new NodeSelectionStats());
    }

    @Override
    public PartitionFunction getPartitionFunction(Session session, PartitioningScheme partitioningScheme, List<Type> partitionChannelTypes)
    {
        return super.getPartitionFunction(session, partitioningScheme, partitionChannelTypes);
    }

    @Override
    public List<ConnectorPartitionHandle> listPartitionHandles(Session session, PartitioningHandle partitioningHandle)
    {
        return super.listPartitionHandles(session, partitioningHandle);
    }

    @Override
    public NodePartitionMap getNodePartitioningMap(Session session, PartitioningHandle partitioningHandle)
    {
        throw new UnsupportedOperationException("grouped execution is not supported in presto on spark");
    }

    @Override
    public BucketNodeMap getBucketNodeMap(Session session, PartitioningHandle partitioningHandle, boolean preferDynamic)
    {
        throw new UnsupportedOperationException("grouped execution is not supported in presto on spark");
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Disable grouped execution in the session (set grouped-execution / node-partitioning related session properties off)
  2. Remove query.node-partitioning or similar connector table properties that force bucketed node partitioning
  3. Update the query so it does not rely on grouped execution features when running on Spark

Example fix

// before
SET SESSION grouped_execution_for_eligible_queries = true;
// after
SET SESSION grouped_execution_for_eligible_queries = false; -- grouped execution unsupported on Spark
Defensive patterns

Strategy: validation

Validate before calling

if (session.getSystemProperty("grouped_execution_for_eligible_queries").equals("true")) {
    throw new PrestoException(NOT_SUPPORTED, "disable grouped execution on Spark");
}

Try / catch

try { planFragmenter.fragment(...) } catch (UnsupportedOperationException e) { if (e.getMessage().contains("grouped execution")) { log.error("grouped execution must be disabled", e); } throw e; }

Prevention

When it happens

Trigger: A session with grouped execution enabled (e.g. query.node-partitioning or stage grouped execution plan property) causes the planner/scheduler to request a node partitioning map for a partitioning handle via getNodePartitioningMap.

Common situations: Session property grouped-execution-for-eligible-queries or node partitioning settings enabled on a Presto-on-Spark cluster; queries copied from a Presto-on-Hive cluster that relied on grouped execution.

Related errors


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