{"record":{"id":"baa591d2ecdbd4a6","repo":"prestodb/presto","slug":"unsupported-cassandra-type-s","errorCode":null,"errorMessage":"Unsupported Cassandra type: %s","messagePattern":"Unsupported Cassandra type: (.+?)","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-cassandra/src/main/java/com/facebook/presto/cassandra/CassandraType.java","lineNumber":240,"sourceCode":"        }\n        else if (dataType instanceof com.datastax.oss.driver.api.core.type.MapType) {\n            return MAP;\n        }\n        else if (dataType instanceof com.datastax.oss.driver.api.core.type.SetType) {\n            return SET;\n        }\n        else if (dataType instanceof com.datastax.oss.driver.api.core.type.TupleType) {\n            return TUPLE;\n        }\n        // VectorType extends CustomType, so this branch must precede the CustomType check below.\n        else if (dataType instanceof com.datastax.oss.driver.api.core.type.VectorType) {\n            return VECTOR;\n        }\n        else if (dataType instanceof com.datastax.oss.driver.api.core.type.CustomType) {\n            return CUSTOM;\n        }\n        else {\n            throw new NotSupportedException(format(\"Unsupported Cassandra type: %s\", dataType));\n        }\n    }\n\n    public static NullableValue getColumnValue(Row row, int position, FullCassandraType fullCassandraType)\n    {\n        return getColumnValue(row, position, fullCassandraType.getCassandraType(), fullCassandraType.getTypeArguments());\n    }\n\n    public static NullableValue getColumnValue(Row row, int position, CassandraType cassandraType,\n            List<CassandraType> typeArguments)\n    {\n        Type nativeType = cassandraType.getNativeType();\n        if (row.isNull(position)) {\n            return NullableValue.asNull(nativeType);\n        }\n        else {\n            switch (cassandraType) {\n                case ASCII:","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-cassandra/src/main/java/com/facebook/presto/cassandra/CassandraType.java#L222-L258","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Replace the custom-typed column with a supported Cassandra type in the table schema","Exclude the custom column from the query/projection (select only supported columns)","Upgrade the connector to a version supporting the type","Copy data into a new table with standard types and query that instead"],"exampleFix":"// before (cqlsh)\nALTER TABLE t ADD payload <CustomType>;\n\n// after\nALTER TABLE t ADD payload text;","handlingStrategy":"type-guard","validationCode":"for (ColumnMetadata col : table.getColumns()) {\n    DataType dt = col.getType();\n    if (dt instanceof com.datastax.oss.driver.api.core.type.CustomType) {\n        throw new IllegalStateException(\"Column '\" + col.getName()\n            + \"' uses an unsupported custom type; exclude it from queries\");\n    }\n}","typeGuard":"boolean isSupportedCassandraType(DataType dataType) {\n    return !(dataType instanceof com.datastax.oss.driver.api.core.type.CustomType);\n}","tryCatchPattern":"try {\n    return metadata.getTable(handle);\n} catch (NotSupportedException e) {\n    if (e.getMessage().startsWith(\"Unsupported Cassandra type:\")) {\n        return projectOnlySupportedColumns(handle);\n    }\n    throw e;\n}","preventionTips":["Avoid Cassandra custom types in tables queried via Presto","Audit table schemas for custom/unusual types before connector migrations","Standardize on built-in Cassandra types"],"tags":["cassandra","unsupported-type","type-mapping","custom-type"],"backgroundTag":"unsupported-cassandra-type","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}