prestodb/presto · error · PrestoException

NOT_SUPPORTED

NOT_SUPPORTED

Error message

Unsupported column type: 

What it means

appendColumn maps each Presto type to a Cassandra value representation, and any type not explicitly handled (beyond the supported primitives, collections, and VARBINARY) triggers NOT_SUPPORTED. It means the Presto column type cannot be translated into a value the Cassandra driver accepts for inserts.

Source

Thrown at presto-cassandra/src/main/java/com/facebook/presto/cassandra/CassandraPageSink.java:205

        // java.time.Instant which maps directly to that representation.
        // CassandraType maps a CQL `timestamp` column to TIMESTAMP in legacy mode and to
        // TIMESTAMP_WITH_TIME_ZONE in non-legacy mode, so these two branches are mutually exclusive.
        else if (session.getSqlFunctionProperties().isLegacyTimestamp() && TIMESTAMP.equals(type)) {
            // Legacy mode: the raw long is epoch millis with the session timezone ignored (wall-clock treated as UTC).
            values.add(Instant.ofEpochMilli(type.getLong(block, position)));
        }
        else if (!session.getSqlFunctionProperties().isLegacyTimestamp() && TIMESTAMP_WITH_TIME_ZONE.equals(type)) {
            // Non-legacy mode: the long is a packed (UTC millis + timezone key); unpack to get true UTC millis.
            values.add(Instant.ofEpochMilli(unpackMillisUtc(type.getLong(block, position))));
        }
        else if (isVarcharType(type)) {
            values.add(type.getSlice(block, position).toStringUtf8());
        }
        else if (VARBINARY.equals(type)) {
            values.add(type.getSlice(block, position).toByteBuffer());
        }
        else {
            throw new PrestoException(NOT_SUPPORTED, "Unsupported column type: " + type.getDisplayName());
        }
    }

    @Override
    public CompletableFuture<Collection<Slice>> finish()
    {
        log.debug("Finished write to %s.%s with %d rows written", schemaName, tableName, rowsWritten);
        CassandraWriteMetadata metadata = new CassandraWriteMetadata(rowsWritten);
        return completedFuture(ImmutableList.of(metadata.toSlice()));
    }

    @Override
    public void abort() {}
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. CAST the unsupported column to a supported type (e.g. VARCHAR, BIGINT, VARBINARY) in the INSERT statement
  2. Upgrade the Presto/Cassandra connector to a version whose page sink supports the column type
  3. Remove or split off the unsupported column from the INSERT
  4. If a common type is unsupported, file/patch the connector to add handling in appendColumn

Example fix

// before
INSERT INTO t VALUES (json_col);

// after
INSERT INTO t VALUES (CAST(json_col AS VARCHAR));
Defensive patterns

Strategy: validation

Validate before calling

Set<Type> sinkSupported = ImmutableSet.of(BIGINT, INTEGER, SMALLINT, TINYINT, DOUBLE, REAL, BOOLEAN, VARCHAR, VARBINARY, DATE, TIMESTAMP, TIME);
for (ColumnHandle col : insertColumns) {
    Type t = ((CassandraColumnHandle) col).getType();
    if (!sinkSupported.contains(t) && !isSupportedCollection(t)) {
        throw new IllegalArgumentException("CAST unsupported column " + t + " before INSERT");
    }
}

Type guard

boolean isSinkWritable(Type t) {
    return t instanceof VarcharType || t instanceof BigintType
        || t instanceof DoubleType || t instanceof BooleanType
        || t.equals(VARBINARY);
}

Try / catch

try {
    sink.appendPage(page);
} catch (PrestoException e) {
    if (NOT_SUPPORTED.toErrorCode().getCode() == e.getErrorCode().getCode()
            && e.getMessage().startsWith("Unsupported column type:")) {
        throw new IllegalArgumentException("CAST the offending column before INSERT", e);
    }
    throw e;
}

Prevention

When it happens

Trigger: INSERT into a Cassandra table where one of the columns has a Presto type that falls through every branch of the type dispatch in CassandraPageSink.appendColumn — i.e. a type the sink does not support writing.

Common situations: Inserting into tables with exotic or recently added Cassandra types mapped to unsupported Presto types; connector version gaps where the read path supports a type but the sink does not; casting columns to uncommon types before INSERT.

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