prestodb/presto · error · NotSupportedException

Unsupported Cassandra type: %s

Error message

Unsupported Cassandra type: %s

What it means

CassandraType.getCassandraType maps driver DataType objects to the connector's CassandraType enum; a driver CustomType (or any unrecognized type) has no mapping, so NotSupportedException is thrown. It means the table contains a Cassandra column type the connector cannot interpret.

Source

Thrown at presto-cassandra/src/main/java/com/facebook/presto/cassandra/CassandraType.java:240

        }
        else if (dataType instanceof com.datastax.oss.driver.api.core.type.MapType) {
            return MAP;
        }
        else if (dataType instanceof com.datastax.oss.driver.api.core.type.SetType) {
            return SET;
        }
        else if (dataType instanceof com.datastax.oss.driver.api.core.type.TupleType) {
            return TUPLE;
        }
        // VectorType extends CustomType, so this branch must precede the CustomType check below.
        else if (dataType instanceof com.datastax.oss.driver.api.core.type.VectorType) {
            return VECTOR;
        }
        else if (dataType instanceof com.datastax.oss.driver.api.core.type.CustomType) {
            return CUSTOM;
        }
        else {
            throw new NotSupportedException(format("Unsupported Cassandra type: %s", dataType));
        }
    }

    public static NullableValue getColumnValue(Row row, int position, FullCassandraType fullCassandraType)
    {
        return getColumnValue(row, position, fullCassandraType.getCassandraType(), fullCassandraType.getTypeArguments());
    }

    public static NullableValue getColumnValue(Row row, int position, CassandraType cassandraType,
            List<CassandraType> typeArguments)
    {
        Type nativeType = cassandraType.getNativeType();
        if (row.isNull(position)) {
            return NullableValue.asNull(nativeType);
        }
        else {
            switch (cassandraType) {
                case ASCII:

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Replace the custom-typed column with a supported Cassandra type in the table schema
  2. Exclude the custom column from the query/projection (select only supported columns)
  3. Upgrade the connector to a version supporting the type
  4. Copy data into a new table with standard types and query that instead

Example fix

// before (cqlsh)
ALTER TABLE t ADD payload <CustomType>;

// after
ALTER TABLE t ADD payload text;
Defensive patterns

Strategy: type-guard

Validate before calling

for (ColumnMetadata col : table.getColumns()) {
    DataType dt = col.getType();
    if (dt instanceof com.datastax.oss.driver.api.core.type.CustomType) {
        throw new IllegalStateException("Column '" + col.getName()
            + "' uses an unsupported custom type; exclude it from queries");
    }
}

Type guard

boolean isSupportedCassandraType(DataType dataType) {
    return !(dataType instanceof com.datastax.oss.driver.api.core.type.CustomType);
}

Try / catch

try {
    return metadata.getTable(handle);
} catch (NotSupportedException e) {
    if (e.getMessage().startsWith("Unsupported Cassandra type:")) {
        return projectOnlySupportedColumns(handle);
    }
    throw e;
}

Prevention

When it happens

Trigger: Querying a table whose column uses a Cassandra custom type (or a driver type outside all instanceof branches in getCassandraType) during type mapping at planning time.

Common situations: Tables created with custom C* types (e.g. legacy 'CustomType' classes); newly introduced Cassandra types used before connector support; cross-version clusters where the driver reports an unknown type.

Related errors


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