prestodb/presto · error · PrestoException
NOT_SUPPORTED
NOT_SUPPORTED
Error message
Inserting into bucketed tables with skew is not supported. %s
What it means
checkWritable refuses writes to Hive tables/partitions that are both bucketed and skewed. Presto's bucketing writer cannot preserve the skewed-bucket layout the table declares, so writing would corrupt bucketing invariants. The exception carries the table/partition description for diagnosis.
Source
Thrown at presto-hive/src/main/java/com/facebook/presto/hive/HiveWriteUtils.java:405
Map<String, String> parameters,
Storage storage)
{
String tablePartitionDescription = "Table '" + tableName + "'";
if (partitionName.isPresent()) {
tablePartitionDescription += " partition '" + partitionName.get() + "'";
}
// verify online
verifyOnline(tableName, partitionName, protectMode, parameters);
// verify not read only
if (protectMode.readOnly) {
throw new HiveReadOnlyException(tableName, partitionName);
}
// verify skew info
if (storage.isSkewed()) {
throw new PrestoException(NOT_SUPPORTED, format("Inserting into bucketed tables with skew is not supported. %s", tablePartitionDescription));
}
}
public static Path getTableDefaultLocation(ConnectorSession session, SemiTransactionalHiveMetastore metastore, HdfsEnvironment hdfsEnvironment, String schemaName, String tableName)
{
MetastoreContext metastoreContext = new MetastoreContext(
session.getIdentity(),
session.getQueryId(),
session.getClientInfo(),
session.getClientTags(),
session.getSource(),
getMetastoreHeaders(session),
isUserDefinedTypeEncodingEnabled(session),
metastore.getColumnConverterProvider(),
session.getWarningCollector(),
session.getRuntimeStats());
Optional<String> location = getDatabase(session.getIdentity(), metastoreContext, metastore, schemaName).getLocation();
if (!location.isPresent() || location.get().isEmpty()) {View on GitHub (pinned to 55bb57d202)
Solutions
- Remove the skew specification: recreate the table without SKEWED BY, copy data, and swap names
- Write to a different (non-skewed) staging table from Presto, then load into the skewed table via Hive itself
- If skew metadata is stale, drop the skew info in the metastore (ALTER TABLE ... NOT SKEWED / update table properties) if it no longer reflects reality
Example fix
// before CREATE TABLE t (k int) CLUSTERED BY (k) INTO 4 BUCKETS SKEWED BY (k) ON (1,2); -- insert fails // after CREATE TABLE t (k int) CLUSTERED BY (k) INTO 4 BUCKETS;
Defensive patterns
Strategy: validation
Validate before calling
Table t = metastore.getTable(schema, table);
if (t.getStorage().isSkewed() && t.getStorage().getBucketProperty().isPresent()) {
throw new IllegalStateException("Target table is bucketed+skewed; not writable from Presto");
} Try / catch
try {
insertInto(skewedTable);
} catch (PrestoException e) {
if (NOT_SUPPORTED.toErrorCode().equals(e.getErrorCode()) && e.getMessage().contains("bucketed tables with skew")) {
// fall back to a staging non-skewed table
} else throw e;
} Prevention
- Avoid SKEWED BY on tables Presto must write to
- Prefer LIST_BUCKETING-free, plain bucketed or unbucketed tables for Presto ingestion
- Audit legacy Hive DDL for skew before migrating write paths to Presto
When it happens
Trigger: INSERT (or CTAS writing into an existing table) whose target HiveTableHandle/storage has isSkewed() true — i.e. the table was created with SKEWED BY and is also bucketed (CLUSTERED BY ... INTO N BUCKETS).
Common situations: Inserting into legacy Hive tables defined with SKEWED BY clause created outside Presto; schema migration bringing skewed bucketed tables into a Presto write path.
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/3eb52fd8da0b0976.
Report an issue: GitHub.