{"record":{"id":"d98b0eccb3a773ef","repo":"prestodb/presto","slug":"not-supported-d98b0e","errorCode":"NOT_SUPPORTED","errorMessage":"Unsupported column type: ","messagePattern":"Unsupported column type: ","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-cassandra/src/main/java/com/facebook/presto/cassandra/CassandraPageSink.java","lineNumber":205,"sourceCode":"        // java.time.Instant which maps directly to that representation.\n        // CassandraType maps a CQL `timestamp` column to TIMESTAMP in legacy mode and to\n        // TIMESTAMP_WITH_TIME_ZONE in non-legacy mode, so these two branches are mutually exclusive.\n        else if (session.getSqlFunctionProperties().isLegacyTimestamp() && TIMESTAMP.equals(type)) {\n            // Legacy mode: the raw long is epoch millis with the session timezone ignored (wall-clock treated as UTC).\n            values.add(Instant.ofEpochMilli(type.getLong(block, position)));\n        }\n        else if (!session.getSqlFunctionProperties().isLegacyTimestamp() && TIMESTAMP_WITH_TIME_ZONE.equals(type)) {\n            // Non-legacy mode: the long is a packed (UTC millis + timezone key); unpack to get true UTC millis.\n            values.add(Instant.ofEpochMilli(unpackMillisUtc(type.getLong(block, position))));\n        }\n        else if (isVarcharType(type)) {\n            values.add(type.getSlice(block, position).toStringUtf8());\n        }\n        else if (VARBINARY.equals(type)) {\n            values.add(type.getSlice(block, position).toByteBuffer());\n        }\n        else {\n            throw new PrestoException(NOT_SUPPORTED, \"Unsupported column type: \" + type.getDisplayName());\n        }\n    }\n\n    @Override\n    public CompletableFuture<Collection<Slice>> finish()\n    {\n        log.debug(\"Finished write to %s.%s with %d rows written\", schemaName, tableName, rowsWritten);\n        CassandraWriteMetadata metadata = new CassandraWriteMetadata(rowsWritten);\n        return completedFuture(ImmutableList.of(metadata.toSlice()));\n    }\n\n    @Override\n    public void abort() {}\n}\n","sourceCodeStart":187,"sourceCodeEnd":220,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-cassandra/src/main/java/com/facebook/presto/cassandra/CassandraPageSink.java#L187-L220","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["CAST the unsupported column to a supported type (e.g. VARCHAR, BIGINT, VARBINARY) in the INSERT statement","Upgrade the Presto/Cassandra connector to a version whose page sink supports the column type","Remove or split off the unsupported column from the INSERT","If a common type is unsupported, file/patch the connector to add handling in appendColumn"],"exampleFix":"// before\nINSERT INTO t VALUES (json_col);\n\n// after\nINSERT INTO t VALUES (CAST(json_col AS VARCHAR));","handlingStrategy":"validation","validationCode":"Set<Type> sinkSupported = ImmutableSet.of(BIGINT, INTEGER, SMALLINT, TINYINT, DOUBLE, REAL, BOOLEAN, VARCHAR, VARBINARY, DATE, TIMESTAMP, TIME);\nfor (ColumnHandle col : insertColumns) {\n    Type t = ((CassandraColumnHandle) col).getType();\n    if (!sinkSupported.contains(t) && !isSupportedCollection(t)) {\n        throw new IllegalArgumentException(\"CAST unsupported column \" + t + \" before INSERT\");\n    }\n}","typeGuard":"boolean isSinkWritable(Type t) {\n    return t instanceof VarcharType || t instanceof BigintType\n        || t instanceof DoubleType || t instanceof BooleanType\n        || t.equals(VARBINARY);\n}","tryCatchPattern":"try {\n    sink.appendPage(page);\n} catch (PrestoException e) {\n    if (NOT_SUPPORTED.toErrorCode().getCode() == e.getErrorCode().getCode()\n            && e.getMessage().startsWith(\"Unsupported column type:\")) {\n        throw new IllegalArgumentException(\"CAST the offending column before INSERT\", e);\n    }\n    throw e;\n}","preventionTips":["Verify each INSERT column type is supported by the Cassandra sink before writing","CAST exotic types to VARCHAR/VARBINARY explicitly","Keep connector and Presto versions aligned so sink/read type support matches"],"tags":["cassandra","unsupported-type","insert","type-mapping"],"backgroundTag":"unsupported-column-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"}